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

Add a recipe involving leap seconds to the cookbook #1236

Closed
ByteEater-pl opened this issue Dec 27, 2020 · 3 comments
Closed

Add a recipe involving leap seconds to the cookbook #1236

ByteEater-pl opened this issue Dec 27, 2020 · 3 comments

Comments

@ByteEater-pl
Copy link

Although it was decided this API doesn't support leap seconds, there are use cases requiring it, so it's a valid question how to make good use of Temporal manually combining it with a source of leap second timestamps. One or more such examples would be nice to have in the documentation.

@ryzokuken
Copy link
Member

I attempted to get leap seconds support with the help of a custom 3rd party timezone in https://github.com/ryzokuken/temporal-tai. That said, IIRC, @gibson042 pointed out that the package might not be usable. If you could try it out and help me find out any potential issues, that would bring us closer to a well-known solution to the leap seconds problem.

@ByteEater-pl
Copy link
Author

From a cursory overview of temporal-tai, both before and after filing this issue, I see no issues with it, but if I find any, I'll try to remember to report them. I'm curious what @gibson042's point was.

Your package uses t-a-i which contains hardcoded data about leap seconds in tai-data.js. So, naturally, jus as other solutions, it needs updating. So does leapseconds-announced, a library in the Haskell ecosystem from which I took inspiration, providing a value of type LeapSecondMap in the most popular time library, which supports a lot out of the box, but of course it cannot know leap seconds in advance, therefore an external source is needed for functions accepting values of type LeapSecondMap. I think it would be nice to have in the Temporal API itself: you pass the data about leap seconds and you get calculations taking them into account; barring this, a recipe or two is what I wish for with this issue.

@ptomato
Copy link
Collaborator

ptomato commented Jan 5, 2021

Thanks for the feedback, agreed that this should belong in the documentation. We have #900 open for this, so I'll close this one as a duplicate.

@ptomato ptomato closed this as completed Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants