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

Restrict GetNamedTimeZoneOffsetNanoseconds return value to less than 24 hours #3101

Open
anba opened this issue Jun 15, 2023 · 2 comments
Open

Comments

@anba
Copy link
Contributor

anba commented Jun 15, 2023

GetNamedTimeZoneOffsetNanoseconds should specify that the absolute value of the returned integer is less than nsPerDay (8.64 × 1013).


This came up during review of the Temporal patches for SpiderMonkey.

@michaelficarra
Copy link
Member

Can you explain why a time zone offset can't have a magnitude of 24 hours or more?

@anba
Copy link
Contributor Author

anba commented Jun 16, 2023

This is necessary for compatibility with Temporal (for example tc39/proposal-temporal#2260) and if offsets exceed 24 hours, it's also no longer possible to parse string representations of the offset through UTCOffset, because Hour only goes up to 23.

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

2 participants