java - Calendar getTimeInMills = July 4, 46452? -
i using calendar
on samsung note. if new instance of calendar
calendar.getinstance() , call gettimeinmills() without doing else 1403732346277, apparently value in far future.
i need unix style timestamp. there other preferred way this? or reason why calendar
returning value (i.e. standard adjustment can make)?
unix time represents number of seconds epoch. name implies, gettimeinmillis()
return number of milliseconds epoch. need divide milliseconds 1000 unix time.
long unixtime = calendar.getinstance().gettimeinmillis() / 1000;
Comments
Post a Comment