Skip to content

Temporal.ZonedDateTime.p.getTimeZoneTransition returns an incorrect result #602

Description

@fabon-f

Describe the bug

Temporal.ZonedDateTime.p.getTimeZoneTransition should return future time when a time zone offset changes, but currently boa doesn't do for few cases.

To Reproduce
Steps to reproduce the issue, or JavaScript code that causes this failure.

const errors = {
  'same time': [],
  'past time': [],
  'same offset': [],
};
const edgeCases = [
  // `getTimeZoneTransition` returns ZonedDateTime with same offset
  "2023-03-25T23:00:00-02:00[America/Godthab]",
  "2015-03-08T03:00:00-04:00[America/Grand_Turk]",
  "2006-04-02T03:00:00-05:00[America/Resolute]",
  "2023-10-29T00:00:00-01:00[America/Scoresbysund]",
  "1996-01-01T02:00:00+01:00[Europe/Lisbon]",
  // `getTimeZoneTransition('next')` returns same or past time
  "2011-03-13T01:01:00-03:00[America/Goose_Bay]",
  "2011-03-13T02:59:59-03:00[America/Goose_Bay]",
  "2011-03-13T01:01:00-02:30[America/St_Johns]",
  "2007-03-11T03:00:00-05:00[America/Indiana/Petersburg]",
  "2007-11-04T00:59:59-05:00[America/Indiana/Petersburg]",
  "2007-03-11T03:00:00-05:00[America/Indiana/Vincennes]",
  "2010-03-14T03:00:00-06:00[America/North_Dakota/Beulah]",
  "2022-03-13T03:00:00-06:00[America/Ojinaga]",
  "2009-10-04T03:00:00+11:00[Antarctica/Macquarie]",
  "1998-03-29T01:00:00+03:00[Asia/Nicosia]",
  "1996-10-26T23:00:00+02:00[Europe/Bucharest]",
  "1996-10-26T23:00:00+02:00[Europe/Chisinau]",
  "1996-03-31T03:00:00+03:00[Europe/Kiev]",
  "1996-10-26T23:00:00+02:00[Europe/Sofia]",
  "1999-03-28T03:00:00+02:00[Europe/Vilnius]",
  "2015-10-04T01:30:00+11:00[Pacific/Norfolk]",
];
for (const s of edgeCases) {
  const zdt = Temporal.ZonedDateTime.from(s);
  const transition = zdt.getTimeZoneTransition("next");
  if (Temporal.ZonedDateTime.compare(transition, zdt) === 0) {
    errors['same time'].push(s);
  } else if (Temporal.ZonedDateTime.compare(transition, zdt) === -1) {
    errors['past time'].push(s);
  } else if (transition.offsetNanoseconds === zdt.offsetNanoseconds) {
    errors['same offset'].push(s);
  }
}
errors // { 'same time': Array(14), 'past time': Array(2), 'same offset': Array(5) }

Expected behavior
Explain what you expected to happen, and what is happening instead.

errors should be empty ({ 'same time': [], 'past time': [], 'same offset': [] })

spec: https://tc39.es/proposal-temporal/#sec-temporal-getnamedtimezonenexttransition

Build environment (please complete the following information):

official playground (https://boajs.dev/playground)

Additional context
Add any other context about the problem here.

issue on Chromium: https://issues.chromium.org/issues/443776749 but it's fixed now on latest Chrome Canary. I guess https://chromium-review.googlesource.com/c/v8/v8/+/6933690 fixed this, so perhaps only specific time zone providers are affected (not confirmed though)

Activity

  1. jedel1043 commented on Oct 27, 2025

    @jedel1043
    Member

    @nekevss I'm transferring this issue to temporal_rs

  2. transferred this issue fromboa-dev/boaon Oct 27, 2025
  3. moved this from Backlog to No status in Temporal Implementationon Oct 27, 2025
  4. nekevss commented on Oct 27, 2025

    @nekevss
    Member

    I'll try to take a look at it as soon as possible.

    If it happened in the playground then it's definitely a problem with the resolution logic for the data from jiff_tzdb. I'll try to look at it, and maybe it would be a good idea while in there to work on the logic for the compiled data in timezone_provider

  5. Manishearth commented on Nov 13, 2025

    @Manishearth
    Contributor

    Note that for "returns the same offset", a lot of timezone database models have "fake" transitions that do not actually transition, which the spec wants us to ignore. This is correctly implemented in the zoneinfo64 provider, and maybe the tzif provider (I recall trying to implement it, at least).

  6. added this to the v1.0 blocking milestone on Mar 11, 2026
  7. added theissue type on Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions