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

  1. 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.

  2. Duration Arithmetic

    Pick two instants and watch Temporal.Duration balance, round, and total across years/months/days/hours — the kind of math billing and analytics code reinvents every project.

  3. 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.

  4. 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 to Date-based math with a polyfill banner.

  5. PlainDate Playground

    Interactive explorer for Temporal.PlainDate operations: add/subtract durations, compute differences, sort with compare(). Includes a type hierarchy reference (Instant vs PlainDate vs ZonedDateTime) and a side-by-side gotcha comparison against Date — month indexing, mutation, day-of-week encoding.

  6. 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 using until() 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/

references