PlainDate
A calendar date without time or time zone.
Temporal is the modern JavaScript date and time API. It separates instants, plain dates, wall-clock times and zoned date-times.
if ("Temporal" in globalThis) {
const date = Temporal.PlainDate.from("2026-01-01");
console.log(date.add({ days: 7 }).toString());
}
Dates, Time & Intl
Temporal is designed as a modern replacement for Date. It has separate types for different date-time concepts instead of forcing everything into one mutable Date object.
Temporal.PlainDate represents a calendar date without a time zone. Temporal.Instant represents an exact instant. Temporal.ZonedDateTime represents an instant with a time zone and calendar context.
Temporal is powerful, but not yet something to assume in every browser without checking support. Use feature detection and consider a polyfill where production support requires it.
A calendar date without time or time zone.
A wall-clock time without date or time zone.
A precise moment in time.
Date and time connected to a named time zone.
Examples
const calendarDate = Temporal.PlainDate.from("2026-01-01");
const exactInstant = Temporal.Instant.from("2026-01-01T09:30:00Z");
console.log(calendarDate.toString());
console.log(exactInstant.toString());
const calendarDate = new Date("2026-01-01");
// A calendar date is now forced into instant/time-zone behavior.
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.
Check support before using the API directly.
if ("Temporal" in globalThis) {
console.log("Temporal is available.");
} else {
console.log("Use a fallback or polyfill.");
}
Use PlainDate when the concept has no time zone.
const date = Temporal.PlainDate.from("2026-01-01");
const nextWeek = date.add({ days: 7 });
console.log(nextWeek.toString());
Use Instant for one precise point in time.
const instant = Temporal.Instant.from("2026-01-01T09:30:00Z");
console.log(instant.epochMilliseconds);
Use ZonedDateTime when a named time zone matters.
const zoned = Temporal.ZonedDateTime.from( "2026-01-01T09:30:00+01:00[Europe/Amsterdam]" ); console.log(zoned.toString());
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.
Do not assume Temporal exists everywhere.
PlainDate, Instant and ZonedDateTime mean different things.
Birthdays, deadlines and day-only values often do not need a time zone.
Logs and timestamps represent points in time.
A time zone is part of the meaning.
Temporal methods generally return new values instead of mutating the original.
Production thinking
Temporal makes date-time code more explicit. That lowers the chance of mixing calendar dates, exact instants and time-zone display by accident.
Clear date-time models make it easier to produce unambiguous visible text for users.
Production Temporal usage should include support checks, fallback strategy and tests for time-zone behavior.
Temporal can help generate consistent visible and machine-readable date values, but output still needs correct formatting.
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.
Senior audit upgrade
Last reviewed: 11 June 2026. Temporal is the modern date/time direction, but production use still needs a runtime-support check and a deliberate polyfill policy.
Use these references when browser support, syntax details or proposal status matters.