ecma262
ecma262 copied to clipboard
Restrict GetNamedTimeZoneOffsetNanoseconds return value to less than 24 hours
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.
Can you explain why a time zone offset can't have a magnitude of 24 hours or more?
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.