Closed Bug 2007850 Opened 3 months ago Closed 2 months ago

Temporal: Offset for Europe/Copenhagen in summer 1949 is wrong

Categories

(Core :: JavaScript: Standard Library, defect, P3)

Firefox 146
defect

Tracking

()

RESOLVED MOVED

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].

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.

Component: Untriaged → JavaScript: Standard Library
Product: Firefox → Core
Blocks: temporal
Severity: -- → S3
Priority: -- → P2
Priority: P2 → P3

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.

Status: UNCONFIRMED → RESOLVED
Closed: 2 months ago
Resolution: --- → MOVED
You need to log in before you can comment on or make changes to this bug.