Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: are leap seconds handled correctly? #81

aldrinmartoq opened this issue Feb 10, 2018 · 1 comment

Question: are leap seconds handled correctly? #81

aldrinmartoq opened this issue Feb 10, 2018 · 1 comment


Copy link

@aldrinmartoq aldrinmartoq commented Feb 10, 2018

Reading the source code, it seems that leap seconds are ignored. Are they handled somehow? What would happen to a timezone transition if a leap second is added, are those timestamps recalculated?


@philr philr added the question label Feb 10, 2018
Copy link

@philr philr commented Feb 10, 2018

The times of transitions are described using Unix time (also known as POSIX time). All the calculations performed by TZInfo are also based on Unix time.

Unix time is defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC) on 1 January 1970, minus the number of leap seconds that have occurred since (i.e. treating every day as if it were exactly 86,400 seconds long).

Unix time deals with the insertion of a leap second by repeating a Unix time second. If a leap second were to be deleted, a Unix time second would be skipped.

Because Unix time effectively ignores leap seconds, it is not necessary for any adjustments or recalculations to be made when leap seconds are added.

@philr philr closed this Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants