Instant
One exact moment in history.
Time zones decide how an instant is shown on a clock. Date stores the instant; formatting chooses the zone.
const instant = new Date("2026-01-01T09:30:00Z");
new Intl.DateTimeFormat("en-GB", {
timeZone: "Europe/Amsterdam",
timeStyle: "short"
}).format(instant);
Dates, Time & Intl
A Date object stores one instant. It does not store a named time zone such as Europe/Amsterdam or America/New_York.
When you call local Date methods, JavaScript uses the device local time zone. When you call UTC methods, JavaScript uses UTC. For named zones, use Intl.DateTimeFormat with the timeZone option.
Time-zone bugs often happen when code stores a local wall-clock time as if it were a universal instant, or when display code forgets to specify the intended zone.
One exact moment in history.
A stable reference time zone often used for storage.
The device or environment time zone.
Named zone such as Europe/Amsterdam used by Intl formatting.
Examples
const date = new Date("2026-01-01T09:30:00Z");
const visible = new Intl.DateTimeFormat("en-GB", {
dateStyle: "medium",
timeStyle: "short",
timeZone: "Europe/Amsterdam"
}).format(date);
const date = new Date("2026-01-01T09:30:00Z");
console.log(date.toLocaleString());
// Output changes by device settings.
Code patterns
Dates and time zones become much easier when every example names the concept it represents: instant, local display, UTC output, calendar date, formatted text or zoned time.
Useful for logs and stable technical output.
const date = new Date("2026-01-01T09:30:00Z");
const formatter = new Intl.DateTimeFormat("en-GB", {
dateStyle: "medium",
timeStyle: "short",
timeZone: "UTC"
});
console.log(formatter.format(date));
Use an IANA time zone for intended display.
const date = new Date("2026-01-01T09:30:00Z");
const formatter = new Intl.DateTimeFormat("en-GB", {
timeStyle: "short",
timeZone: "Europe/Amsterdam"
});
console.log(formatter.format(date));
The instant stays the same while the clock text changes.
const date = new Date("2026-01-01T09:30:00Z");
for (const timeZone of ["UTC", "Europe/Amsterdam"]) {
const text = new Intl.DateTimeFormat("en-GB", { timeZone, timeStyle: "short" }).format(date);
console.log(`${timeZone}: ${text}`);
}
Store the instant, then format for the target zone.
const stored = "2026-01-01T09:30:00Z"; const instant = new Date(stored); console.log(instant.toISOString());
Rules that matter
Date-time bugs usually start when storage format, calculation logic and user-facing display are treated as the same thing. Keep those responsibilities separate and the code becomes much easier to trust.
Use ISO UTC strings or timestamps when representing one exact moment.
Use Intl timeZone when the display zone matters.
Localized time-zone output is for users, not storage.
A Date object does not remember Europe/Amsterdam.
Calendar-day logic can shift around DST transitions.
A calendar appointment and an exact instant are not the same concept.
Production thinking
A time-zone bug can show the correct instant at the wrong local time, which is still wrong for the user.
When time zones matter, visible text should include enough context so users know which clock is being used.
Production systems should define whether a value is an instant, a local date, a wall-clock time or a zoned date-time.
Event times should include machine-readable time-zone context where appropriate.
Live code lab
The preview runs inside an isolated iframe. The JavaScript is placed inside the HTML editor for now, so every example stays together and remains easy to understand.
Mini assignment
Practice assignment
Try it yourself
Self-check
Dates are full of traps. Explain the concept first, then run the code and check whether the output matches your mental model.