logoalt Hacker News

zokieryesterday at 2:00 PM1 replyview on HN

The table in Wikipedia is good for clarifying matters:

https://en.wikipedia.org/wiki/Unix_time#Leap_seconds

From there you can clearly see that e.g. Unix time 915148800 lasted two seconds

We can make an analogy to leap days:

- UTC is like Gregorian calendar, on leap years it goes Feb28-Feb29-Mar1 (23:59:59-23:59:60-00:00:00)

- TAI would be just always going from Feb28-Mar1 (23:59:59-00:00:00) and ignoring leap years

- Unix time would be like to go Feb28-Mar1-Mar1 (23:59:59-00:00:00-00:00:00) on leap years, repeating the date

From this it should be pretty obvious why I consider Unix time so bonkers.


Replies

valenterrytoday at 3:39 AM

Indeed, it's the opposite of what I thought. Confusing! Thanks for the clarification.

So in fact, unix seconds can be longer than intuitively expected. Which also means two timestamps of e.g. UTC with different seconds can map to the same unix timestamps.