4 ms·
Correct. POSIX time is defined as number of seconds per (non-leapsecond) day times number of complete day since the epoch, plus the number of seconds in the cur
by chowells 8y ago
Correct. POSIX time is defined as number of seconds per (non-leapsecond) day times number of complete day since the epoch, plus the number of seconds in the current day.
POSIX timestamps get weird around leap seconds. Time stamps get repeated, subtraction returns incorrect results, and so on.
- leeter 8y agoIIRC google and the like solve this using a special time routine in their kernels that literally just spread the second out across the day. It's close enough.. and legal will still accept it for auditing requirements.
- mike_hearn 8y agoIf you use Java and the java.time API they added in the last release, you're covered for all of this. https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html https://docs.oracle.com/javase/8/docs/api/java/time/Instant.... In this segment, the Java Time-Scale is identical to UTC-SLS. This is identical to UTC on days that do not have a leap second. On days that do have a leap second, the leap second is spread equally over the last 1000 seconds of the day, maintaining the appearance of exactly 86400 seconds per day. Java apps don't use UNIX time, they use something very similar called the Java timeline which is basically the same as UTC but leap seconds are smeared. The java.time API is really incredibly thorough. It does of course have support for Japanese dates: https://docs.oracle.com/javase/8/docs/api/java/time/chrono/JapaneseDate.html https://docs.oracle.com/javase/8/docs/api/java/time/chrono/J... The type system and runtime checks also catch subtle errors like assuming "one day from now" and "in 24 hours from now" are the same thing.