Question Details

No question body available.

Tags

javascript temporal

Answers (1)

Accepted Answer Available
Accepted Answer
March 20, 2026 Score: 4 Rep: 47,351 Quality: Expert Completeness: 100%

To avoid conflicts between the time zones of both objects, you cannot format a Temporal.ZonedDateTime with Intl.DateTimeFormat. Instead, you should do one of the following:

  • If all you want to do is simple formatting outside and are not formatting a huge number of timestamps, then call toLocaleString on that Temporal.ZonedDateTime object. This method takes the same arguments as the Intl.DateTimeFormat constructor, although it's slower because a new formatter needs to be created each time.

  • If you need different formatting (e.g. formatToParts) or are formatting a long list of timestamps, consider using Intl.DateTimeFormat, like this:

    zdt = Temporal.ZonedDateTime.from('2026-03-19T00:00[America/LosAngeles]');
    new Intl.DateTimeFormat({ timeZone: zdt.timeZoneId }).format(zdt.toInstant());
    

The challenge with formatting Temporal.ZonedDateTime with Intl.DateTimeFormat is that both of them can carry a time zone.

zdt = Temporal.ZonedDateTime.from('2026-03-19T00:00[America/LosAngeles]');
new Intl.DateTimeFormat({ timeZone: 'Asia/Tokyo' }).format(zdt);

So you need to decide what should happen if they conflict. We (the TC39 members who designed the Temporal API) argued about this one for a long time but were not able to agree on a behavior.

https://github.com/js-temporal/proposal-temporal-v2/issues/38 has a good summary of the work done so far. Because the solution in current Temporal is to throw an exception, this leaves space for a future TC39 proposal to come up with a non-throwing solution.