7 ms·
I'm pretty sure UTC is monotonic too, its unix timestamps that really are the true mess
by zokier 4y ago
I'm pretty sure UTC is monotonic too, its unix timestamps that really are the true mess
- Epa095 4y agoYeah you are right, when a leap second is introduced it becomes 23:59:60 (monotonic) in utc, while with unix-time a normal way to handle it is to repeat 23:59:59 twice (non-monotonic).
- Strom 4y agoLeap seconds can be negative.
- toast0 4y agoA negative leap second means that 23:59:59 is skipped, you go from 23:59:58 to 00:00:00, which is monotonically increasing, in both UTC and unixtime. Positive leap seconds are monotonically increasing in UTC, where you get 23:59:60 between 23:59:59 and 00:00:00, but not in typical implementations of unix time where 23:59:59 repeats, and with milliseconds you go (breifly) 58.999 -> 59.0 -> 59.999 -> 59.0 -> 59.999 -> 0.0 If you're only counting seconds, then both UTC and unixtime are always monotonically increasing.
- deleted 4y ago[deleted]
- brazzy 4y agoWrong. The very topic of this discussion, leap seconds, are non-monotonic adjustments to UTC.
- zokier 4y agoIn what way are leap seconds non-monotonic in UTC?
- deathanatos 4y agoUTC is monotonic, even during leap seconds. (A positive leap second adds a 23:59:60; no timestamp ever repeats, the clock never moves backwards.) (Negative leap seconds are similar, and do not affect the monotonic property.) POSIX/Unix timestamps, however, are non-monotonic. But that's a different timescale.