ecma262 icon indicating copy to clipboard operation
ecma262 copied to clipboard

Restrict GetNamedTimeZoneOffsetNanoseconds return value to less than 24 hours

Open anba opened this issue 2 years ago • 2 comments

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.

anba avatar Jun 15 '23 11:06 anba

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

michaelficarra avatar Jun 15 '23 22:06 michaelficarra

This is necessary for compatibility with Temporal (for example https://github.com/tc39/proposal-temporal/pull/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.

anba avatar Jun 16 '23 05:06 anba