rgvcorley
rgvcorley

Reputation: 2933

How does unix timestamp deal with leapseconds?

Leap seconds are added to correct for variations in the Earth's rotation. However, unlike leap years these do not occur at regular intervals (because it is not due to a systematic error, like leap years).

How are leap seconds handled by systems that use unix timestamps? Are leap seconds hard-coded into updates of programming languages that implement timestamps?

Update: looks like Unix timestamps don't deal with leap seconds

Upvotes: 3

Views: 109

Answers (1)

Mr. Lynch
Mr. Lynch

Reputation: 21

It is handled in the time server, not in the programming languages per se. If a second is being lost, the time server reports a 61st second at the end of the day (with a value of 60); if gained, the seconds of UTC go 56, 57, 58, 00, 01.

Upvotes: 1

Related Questions