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

UTCTime cannot represent leap seconds #3

Open
liyang opened this issue Sep 4, 2013 · 3 comments
Open

UTCTime cannot represent leap seconds #3

liyang opened this issue Sep 4, 2013 · 3 comments
Assignees

Comments

@liyang
Copy link
Member

liyang commented Sep 4, 2013

UTCTime is represented as a NominalDiffTime since MJD epoch.

This is problematic since we now cannot distinguish between leap seconds and the following second that belongs to the next day.

@ghost ghost assigned liyang Sep 4, 2013
@liyang
Copy link
Member Author

liyang commented Sep 10, 2013

But UTCView can. Perhaps that's okay if we make it official (and rename it to something sensible, and fix Data.Thyme.Clock.TAI to accept it instead of UTCTime.) I'd like to know if/how people actually deal with leap seconds before making changes to the interface though.

In any case, I'm not aware of any common OS interface that allows one to query for the absolute time (TAI) that doesn't involve working backwards from a UTC time communicated over NTP, so we're stuck with getCurrentTime returning UTCTime for now.

There is a current proposal to abolish leap seconds and perhaps adopt a new time scale (TI?). The vote is due in 2015, unless it ends up being postponed again.

@liyang liyang closed this as completed Sep 10, 2013
@liyang liyang reopened this Sep 11, 2013
@ygale
Copy link

ygale commented Nov 30, 2015

In November 2015 the ITU decided that leap seconds remain with us for the foreseeable future - at least until 2023. We should fix this now.

I think the ideas of @liyang to resolve this are good. But in my opinion, the biggest issue here is documentation. thyme uses the name UTCTime for its most common representation of time, for compatibility with the time library. But that is confusing. This UTCTime is not actually UTC. Whatever we do or don't do with the types and functions, we must make that very clear to users, and make it very clear how to use actual UTC in the thyme library when that is needed.

@llelf
Copy link

llelf commented Sep 14, 2016

Just found out about this. This is a major issue, could we add a little info at least to Data.Thyme.Time / front haddock page, where people are looking first?

Could it be fixed by storing time modulo 86401 instead of 86400?

tmcgilchrist referenced this issue in tmcgilchrist/thyme Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants