|
|
|
|
|
by bxparks
1401 days ago
|
|
Even more confusing, the time printed by our computers may appear to be UTC, but is probably POSIX (or Unix) time. It is very close to UTC but ignores leap seconds. https://en.wikipedia.org/wiki/Unix_time During a positive leap second, the POSIX second repeats itself (an alternative mental model could be that the given POSIX-second lasts 2 UTC-seconds). During a negative leap second, the given POSIX-second disappears (or alternatively, the given POSIX-second lasts 0 UTC-seconds). On my Ubuntu box, the `date +%s` command prints the number of POSIX seconds since 1970-01-01, not the number of UTC seconds since 1970-01-01. To get the number of UTC seconds, we must add the number of intervening leap seconds since 1970-01-01. I get a headache every time I have to think about this. |
|
When you want to know the number of SI seconds between two dates in either posix or UTC you need an accurate table of past leapseconds. If you want to compute TAI from posix or UTC you need an accurate table of leap seconds that your UTC clock has applied (which may not be the same as the table of leap seconds, since you might have missed the most recent one!).