UNIX time ignores leap seconds.
I.e. it's the number of seconds ignoring leap seconds since 1970.
UNIX time ignores leap seconds.
I.e. it's the number of seconds ignoring leap seconds since 1970.
Side note but I always found this phrasing to be incredibly confusing (hence the need for the "i.e."...); it's the exact opposite of what I would think it means to "ignore" leap seconds. Ignoring something means you don't change your behavior when that something happens. But when leap seconds happen, the epoch timestamp halts its counting. That's not ignoring leap seconds -- that's actively countering the leap seconds!
Normally, UNIX time goes up by one each second.
Unless, it's a leap second, in which case UNIX time does nothing.
Example: You're driving your car when pedestrians appear in front of you. What does "ignoring" them constitute? Stopping the car, or running into them at the previous speed?
At the point they needed to be inserted, Unix systems carry on counting seconds as units of time as they pass, "ignoring" the need to add 1 for the purposes of accounting.
unix systems essentially will roll back clocks during leap seconds. here is handy dandy table as an example:
Time tv_sec tv_usec
2015-06-30T23:59:58.9Z 1435708798 900000
2015-06-30T23:59:59.0Z 1435708799 0
2015-06-30T23:59:59.1Z 1435708799 100000
... ... ...
2015-06-30T23:59:59.9Z 1435708799 900000
2015-06-30T23:59:60.0Z 1435708799 0
2015-06-30T23:59:60.1Z 1435708799 100000
... ... ...
2015-06-30T23:59:60.9Z 1435708799 900000
2015-07-01T00:00:00.0Z 1435708800 0
2015-07-01T00:00:00.1Z 1435708800 100000
... ... ...
I don't know about you but I wouldn't call that "counting seconds as units of time as they pass"But when I count people passing me, I press my clicker each time to count them. Except once in a while I don't do anything, i.e. ignore them.
Doing anything else means handling them by adding custom behavior.
You can make a pretty good argument that "every day is 86400 seconds" is ignoring leap seconds. And that's what "Unix time" does.
Though you can also make a good argument that "seconds since 1970, no idea what a 'day' is" ignores leap seconds.
And apparently these strings don't have second 60.
Works for me.
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1...