Temporal: Offset for Europe/Copenhagen in summer 1949 is wrong
Categories
(Core :: JavaScript: Standard Library, defect, P3)
Tracking
()
People
(Reporter: v.n.suadicani, Unassigned)
References
(Blocks 1 open bug)
Details
Steps to reproduce:
Temporal.ZonedDateTime.from("1949-08-07T00:00:00+01:00[Europe/Copenhagen]"); fails with RangeError: date-time can't be represented in the given time zone.
Parsing without the offset, i.e. Temporal.ZonedDateTime.from("1949-08-07T00:00:00[Europe/Copenhagen]"); gives back Temporal.ZonedDateTime 1949-08-07T00:00:00+02:00[Europe/Copenhagen], but this is wrong - Denmark did not observe DST in 1949 and was +1 throughout the year (see e.g. https://www.timeanddate.com/time/zone/denmark/copenhagen?year=1940).
I have Rust code locally using the jiff crate, which (correctly) produced the 1949-08-07T00:00:00+01:00[Europe/Copenhagen] timestamp, however Firefox fails to parse it when it is received by the browser.
I also checked Firefox nightly and it is the same problem. I also tried in Chrome, and it has the same issue, so I'm wondering if there's something deeper wrong here. I have no idea if this affects other timezones or other historical times though.
Actual results:
Temporal.ZonedDateTime.from("1949-08-07T00:00:00+01:00[Europe/Copenhagen]"); throws a RangeError.
Expected results:
Temporal.ZonedDateTime.from("1949-08-07T00:00:00+01:00[Europe/Copenhagen]"); should parse correctly as Temporal.ZonedDateTime 1949-08-07T00:00:00+01:00[Europe/Copenhagen].
Also, Temporal.ZonedDateTime 1949-08-07T00:00:00[Europe/Copenhagen] should parse as Temporal.ZonedDateTime 1949-08-07T00:00:00+01:00[Europe/Copenhagen], not Temporal.ZonedDateTime 1949-08-07T00:00:00+02:00[Europe/Copenhagen].
Comment 1•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::JavaScript: Standard Library' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•3 months ago
|
Updated•3 months ago
|
Comment 2•2 months ago
|
||
The IANA time zone database doesn't provide any guarantees for dates before 1970 (https://data.iana.org/time-zones/theory.html#scope). For example Europe/Copenhagen is defined as a link to Europe/Berlin when using the default settings, only when additionally using the backzone file, the pre-1970 rules for Europe/Copenhagen are used.
Browser implementations don't treat Europe/Copenhagen as a proper link to Europe/Berlin, because we don't want to merge time zones across different regions, see also https://tc39.es/ecma402/#sec-use-of-iana-time-zone-database.
I've filed https://github.com/tc39/proposal-temporal/issues/3248 in case this is something which should be documented/handled better.
Description
•