3 ms·
The problem with Unix timestamps is that it doesn't take leap seconds into account, which makes it ambiguous during a leap second and makes it messy to compute
by winternewt 3y ago
The problem with Unix timestamps is that it doesn't take leap seconds into account, which makes it ambiguous during a leap second and makes it messy to compute the duration between two timestamps.
I think you're on the right track but a timestamp should only count the actual number of seconds that have passed, not some half-measure that tries to align with the rotation of the earth.
- frumiousirc 3y agoAh, thanks. I didn't know that Unix time is discontinuous over leap seconds! I had thought just the opposite. And now I understand some system failures I know about that occurred during leap seconds but which I've never understood. I think to handle leap seconds, one must carry around both Unix timestamp and a "leap delta". The timestamp is needed to convert to calendar/clock representation and the "leap delta" is needed to compare two Unix timestamps for actual elapsed time. What a headache!