I have a int value and from int value I want to obtain Date object for that int value.
Example:
int value = 166368;
long l = (long)value;
Date date = new Date(l);
Value is my integer value for which I want Date object for this particular value.
Now I want to obtain Date for this int value. I try to convert this int value to long and then set the long value in Date object but it not return correct value.
So how to achieve this?
If the long value you pass is milliseconds since the epoch (1-Jan-1970), and 166368 ms = 166.3 seconds < 3 min, I’d say that you should be getting 1-Jan-1970 as the Date value. Correct?