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

Leap seconds #346

Open
oehmke opened this issue Jan 28, 2025 · 1 comment · May be fixed by #347
Open

Leap seconds #346

oehmke opened this issue Jan 28, 2025 · 1 comment · May be fixed by #347
Assignees
Labels
TimeMgr who: NASA Originates from NASA

Comments

@oehmke
Copy link
Contributor

oehmke commented Jan 28, 2025

The idea of handling leap seconds came up on the NASA call. They don't need them now, and they don't foresee needing them any time soon. However, they were just wondering if we had thought about them. It would be good to at least document the fact that we don't consider them in the TimeManger. Also, while we are looking at changing some functionality in the TimeManager, it might make sense to think about the issue a bit.

@oehmke oehmke added TimeMgr who: NASA Originates from NASA labels Jan 28, 2025
@billsacks
Copy link
Member

I just did a moment's research on this and it frankly sounds like a nightmare. From the Wikipedia page on Leap seconds (see particularly the bolded bit at the end – emphasis mine):

The leap second was introduced in 1972. Since then, 27 leap seconds have been added to UTC, with the most recent occurring on December 31, 2016.[1] All have so far been positive leap seconds, adding a second to a UTC day; while it is possible for a negative leap second to be needed, this has not happened yet.

Because the Earth's rotational speed varies in response to climatic and geological events,[2] UTC leap seconds are irregularly spaced and unpredictable. Insertion of each UTC leap second is usually decided about six months in advance by the International Earth Rotation and Reference Systems Service (IERS), to ensure that the difference between the UTC and UT1 readings will never exceed 0.9 seconds.[3][4]

This practice has proven disruptive, particularly in the twenty-first century and especially in services that depend on precise timestamping or time-critical process control. And since not all computers are adjusted by leap-second, they will display times differing from those that have been adjusted.[5] After many years of discussions by different standards bodies, in November 2022, at the 27th General Conference on Weights and Measures, it was decided to abandon the leap second by or before 2035.[6][7]

So the best we could do would seem to be a hard-coded list of past times when a leap second was introduced. But even then, I can only begin to envision the mess this would cause. For example, any kind of arithmetic on times would become extraordinarily complex in the presence of leap seconds. (e.g., connected to the other recent NASA issue, modulo on times would much more often need to be left undefined.)

So, unless there is a strong need for this, this does seem like something best to just document as unhandled.

billsacks added a commit that referenced this issue Jan 29, 2025
@billsacks billsacks linked a pull request Jan 29, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TimeMgr who: NASA Originates from NASA
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants