Email or username:

Password:

Forgot your password?
Daphne Preston-Kendal

Unix time is *not* the number of seconds since 1 January 1970.

No, it’s not because of leap seconds, although that’s part of it.

It’s because from 1970 to 1972, there were two different definitions of a second. UTC seconds were longer than SI seconds.

Unix time is actually the number of seconds since 1972, plus 6,307,200 seconds, minus leap seconds.

If you subtract those 6,307,200 seconds, you do not get exactly back to what people in 1970 called midnight 1 January.

2 comments | Expand all CWs
screwlisp

@dpk
Is there a name for defining years to be exactly pi times ten to the seven seconds consequences be damned?

Daphne Preston-Kendal

They could have fixed this by picking 1972 as the epoch. Or they could have picked, say, 2000 as the epoch, and they would have had enough negative timestamps for all of computing history in the 20th century and 30 years’ reprieve for (what we know as) the 2038 problem.

As with everything in Unix, they could have fixed it in so many ways.

Go Up