2 ms·
Unix timestamps cause a barrel of fun when leap seconds roll around. See e.g. https://access.redhat.com/articles/15145#known https://access.redhat.com/articles
by colanderman 11y ago
Unix timestamps cause a barrel of fun when leap seconds roll around. See e.g. https://access.redhat.com/articles/15145#known https://access.redhat.com/articles/15145#known
Trivia: "Unix time" is not seconds since midnight January 1, 1970 UTC. It in fact represents the number of full days since January 1, 1972 UTC, plus 730, times 86400, plus the number of seconds since midnight. Due to this definition, it is not monotonic, as it may occasionally have discontinuities of 1 second (in either direction!) due to leap seconds.
Best is to just count seconds since some epoch (e.g. Unix time based on TAI rather than UTC), but not many systems actually do this.
- Johnny_Brahms 11y agoWe were bitten by this once, and we ended up relying on TAI and then making leap second deviations _very_ clear to users. I never really got what the problem was, but apparently someone had been careless about comparing times on some transaction which ended up giving a client a bad day. This was some time ago, and if this stuff actually matters to you you probably know how to deal with it.