v144 · javascript
Temporal in ECMA262
Temporal API https://github.com/tc39/proposal-temporal in ECMA262 is a new API that provides standard objects and functions for working with dates and times. Date has been a long-standing pain point in ECMAScript. This proposes Temporal, a global Object that acts as a top-level namespace (like Math), that brings a modern date/time API to the ECMAScript lang
concepts
-
Temporal Walkthrough
The Temporal API ships in V8 — a complete replacement for Date with proper time zone, calendar, and duration support. No more month-zero-indexing surprises.
-
Duration Arithmetic
Pick two instants and watch
Temporal.Durationbalance, round, and total across years/months/days/hours — the kind of math billing and analytics code reinvents every project. -
Calendar Explorer
One ISO date rendered in eight calendar systems — Hebrew, Islamic, Persian, Japanese, Buddhist, Chinese, Indian, Ethiopic — with stable month codes and era names. Calendars are a first-class object, not an Intl string.
-
Time Zone Converter
Convert any timestamp between 12 IANA time zones. Detects DST gaps and folds by comparing
disambiguation: 'earlier'vs'later'interpretations, finds the next offset transition, and shows both UTC offsets. Falls back toDate-based math with a polyfill banner. -
PlainDate Playground
Interactive explorer for
Temporal.PlainDateoperations: add/subtract durations, compute differences, sort withcompare(). Includes a type hierarchy reference (Instant vs PlainDate vs ZonedDateTime) and a side-by-side gotcha comparison againstDate— month indexing, mutation, day-of-week encoding. -
Scheduling & Recurrence
Real-world scheduling: next business day (skip weekends via
dayOfWeek), N-th weekday of a month (e.g. "3rd Tuesday of August"), recurring event occurrences (weekly/biweekly/monthly/quarterly), and a countdown usinguntil()with balanced months and days.
why it shipped
Date has been a long-standing pain point in ECMAScript. This proposes Temporal, a global Object that acts as a top-level namespace (like Math), that brings a modern date/time API to the ECMAScript language. For a detailed breakdown of motivations, see: Fixing JavaScript Date https://maggiepint.com/2017/04/09/fixing-javascript-date-getting-started/