Browsed by
Tag: Unix

Java Timestamp vs Unix Timestamp

Java Timestamp vs Unix Timestamp

Unix timestamp is the number of seconds that have elapsed since midnight of January 1st 1970. To display unix timestamp in shell type: date +%s Sample output is a ten digit number: 1385726996   Java timestamp is the number of milliseconds that have elapsed since midnight of January 1st 1970 (thirteen digit number).

  To display unix timestamp in Java you can divide Java timestamp value by 1000:

  See also: Wikipedia – Year 2038 problem