5 ms·
UTC time does not go backwards. Leap seconds are implemented as a minute with 61 seconds.
by jvdh 14y ago
UTC time does not go backwards. Leap seconds are implemented as a minute with 61 seconds.
- emmapersky 14y agoIt can also, theoretically be a minute with 59 seconds, though I don't believe this has ever happened.
- jvdh 14y agoTrue, but that still is not going backwards.
- cperciva 14y agoOk, I oversimplified. UTC time does not go backwards, but the value returned by POSIX time(3) -- which is supposed to be the number of seconds since 1970-01-01 00:00:00 UTC -- does. (Assuming you have sub-second precision, of course; time_t isn't required to be an integer type, and there's other APIs which access the same UTC-seconds clock and provide microsecond or nanosecond precision.)
- deleted 14y ago[deleted]
- maggit 14y agoThe value returned by POSIX time is commonly said to be "POSIX time" or "UNIX time". This names a time system other than UTC. In my experience, programmers don't seem to confuse these two systems. I have seen good programmers be surprised by the fact that POSIX time goes backwards in the event of leap seconds, as I was when I learned it. I think it would have at least as much punch if you edited your "falsehood 2" to be about UNIX time instead of UTC. As a bonus, you would also be correct ;)
- cperciva 14y agoYeah, I should have just said UNIX time.