|
|
|
|
|
by Dansvidania
19 days ago
|
|
I don't think I understand.. can you please dumb it down even more? I'd figured that UNIX time just counts actual seconds and that leap seconds and similar calendar shenanigans would be a problem of mapping epoch to the correct date, so that if normally epoch X maps to date D then both epoch X and X+1 map to date D. Am i to understand that leap seconds "stretch" a epoch unit ? so that some epoch second "lasted longer". |
|
Unix time assumes a fixed number of seconds per day. 86400. If a leap second is inserted, either end of June or end of December, the day is 86401 seconds long.
There are different implementations for how your Unix time will behave 24 hours before to 24 hours after the leap second. A timestamp might just repeat during the leap second or the system changes the length of a second in a time range around the leap second introduction to make up the difference. This is called smearing.
A simple example is the elapsed time between these two timestamps:
Unix time differs by 20 seconds (assuming the system/library doesn't use smearing). But actually elapsed time is 21 seconds, since was the last added leap second. This timestamp cannot be represented by Unix time (again assuming no smearing, with smearing you could).