Hacker News new | ask | show | jobs
by linsomniac 951 days ago
Go ahead and correct it on Wikipedia, I double-checked my understanding against the entry there before posting my message, and re-reading it I think my description matched Wikipedia.

You'll also need to correct it in the time(2) man page, which says:

"number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)." (ubuntu 22.04)

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

1 comments

The time(2) manpage also states

       POSIX.1 defines "seconds since the Epoch" using a formula that
       approximates the number of seconds between a specified time and
       the Epoch. [...] This value is not the same as the actual number of
       seconds between the time and the Epoch, because of leap seconds
       and because system clocks are not required to be synchronized to
       a standard reference [...] see POSIX.1-2008
       Rationale A.4.15 for further rationale
https://man7.org/linux/man-pages/man2/time.2.html#VERSIONS

The word approximates is carrying a lot of weight here. So basically "seconds since the epoch" is a posix codephrase which doesn't actually mean what you'd naively think it does. Why this useful info is buried in the VERSIONS section instead of the main DESCRIPTION I don't know.

For Wikipedia, there is already discussion about the confusing wording of the opening paragraph: https://en.wikipedia.org/wiki/Talk:Unix_time#Flat_out_wrong? but the body of the article is mostly better, and especially the table showing what happens during leap second should clarify matters.