Skip to content

Comment on Designing a REST API: Unix Time vs. ISO-8601 (2013)parent

Comments

Naw that would make way too much sense. Instead, unix time ticks backwards 1 second to sync up with UTC:

    099.75
    100.00
    100.25
    100.50
    100.75
    100.00
    100.25
    100.50
    100.75
    101.00
Maybe some day we’ll get rid of this collective brain damage: https://en.wikipedia.org/wiki/Leap_second#International_prop...
Naw that would make way too much sense. Instead, unix time ticks backwards 1 second to sync up with UTC:

Doesn't that mean that UNIX time is in fact a stopwatch, but to express it in UTC you need to factor in UTC's quirks such as its leap seconds?

No. Like I said, that would make way too much sense.

The hardware RTC on your motherboard is a stopwatch. When a leap second occurs, your system time will be set 1 second backwards which is also 1 second less than what the RTC reports. Then, the new fuckered time will be written to the RTC so it stops acting as a stopwatch and instead tracks unix time.

An application that reads the system unix time 4 times a second (using a monotonic clock for the 250ms delay) and prints it will observe a negative duration in unix time as seen in my previous comment.

to express it in UTC you need to factor in UTC's quirks such as its leap seconds

Oh that would make unix time so much more useful. But no, the UTC quirk is incorporated into unix time the instant a leap second happen as if some nutjob logged into all your servers and changed each clock manually.

Dear God.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.