Skip to content

Support JS Temporal for dates and times #12563

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

Open
jjspace opened this issue Apr 10, 2025 · 2 comments
Open

Support JS Temporal for dates and times #12563

jjspace opened this issue Apr 10, 2025 · 2 comments

Comments

@jjspace
Copy link
Contributor

jjspace commented Apr 10, 2025

Feature

A modern API for working with date and time, meant to supersede the original Date API.

Temporal is meant to replace Date and be much more useful with more precision (down to nanosecond) and standard ways to interact with the concepts of Date and Time (even different calendars). It also has things builtin like Temporal.Duration type objects.

I'm opening this mostly as an FYI to get it on our radar to keep an eye on going forward. The first implementations only just recently dropped in Firefox Nightly and Safari Tech preview.

Very long term I could see this potentially replacing JulianDate. More near term we may want to look at implementing conversion functions like we already have for Date objects to support developers that start to use Temporal in their applications.

I'm personally very excited about the new API and can foresee lots of other devs jumping at the chance to use it in newer applications as it stabilizes in more browsers.

@ggetz
Copy link
Contributor

ggetz commented Apr 15, 2025

Makes sense to be compatible with the API once stabilized in browsers.

Being based on the International Atomic Time standard ,JulianDate provides additional precision than Date. So I would be hesitant to recommend replacing outright it unless Temporal has equivalent precision, which I couldn't glean from the docs.

@jjspace
Copy link
Contributor Author

jjspace commented Apr 15, 2025

I would be hesitant to recommend replacing outright it unless Temporal has equivalent precision, which I could glean from the docs.

AFAIK in general Temporal is designed to support nanosecond precision which is much better than Date's millisecond. Maybe we still have more with JulianDate but I would expect Temporal should be much better for a majority of use cases.

We might still want to keep JulianDate internally but should make sure we can convert to/from Temporal as it stabilizes

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

2 participants