Unix TimeStamp value gets Corrupted

  android, java, unix, unix-timestamp

I’m trying to fetch Unix Timestamp value using below snippet but sometimes the value get corrupted like 11030 or 810 something like random number we don,t get actual date

public static int getUnixTimeStamp() {

Date date = new Date();

return (int) (date.getTime() / 1000);

}

Source: Android Questions

LEAVE A COMMENT