JavaScript

Display a date in an explicit time zone

Use Intl.DateTimeFormat with a timeZone option when a timestamp should be shown in a particular region. Otherwise the environment’s default zone can change the displayed date and time.

Worked example

Node.js example · save as example.mjs and run node example.mjs

const formatter = new Intl.DateTimeFormat("en-CA", {
  timeZone: "America/Toronto", dateStyle: "medium", timeStyle: "short"
});
console.log(formatter.format(new Date("2026-01-15T15:00:00Z")));

How it works

The timestamp describes one instant in UTC. The formatter applies the regional zone’s offset for that date, including daylight-saving rules when applicable. This separates storage of an instant from the reader-facing presentation of it.

Limits and mistakes

A time zone is not a fixed numeric offset throughout the year. Formatting also does not resolve ambiguous local input times during clock changes. Exact punctuation can vary by locale data, so avoid parsing the output for later computation.

Check the result

Confirm the displayed Toronto clock time is 10:00 a.m. for this January timestamp. Repeat with a summer date to verify that daylight-saving behavior is applied.

Sources

Reference documentation for the behavior used in this guide: