# The Same Date Was the Seventh in New York and the Eighth in Tokyo

> Temporal is not a bigger Date API. It is five types that make you say which one you meant, and the three classic Date bugs turn into three type decisions.

- Published: 2026-11-22
- Tags: javascript, nodejs
- Source: https://jsledger.com/blog/temporal-replaces-date/
- Language: en-US
- Author: Jonah Vail

---
One value, two readers:

```js
const d = new Date('2026-03-08');            // a birthday
d.toISOString();                              // 2026-03-08T00:00:00.000Z
d.toLocaleDateString('en-CA', { timeZone: 'America/New_York' });  // 2026-03-07
d.toLocaleDateString('en-CA', { timeZone: 'Asia/Tokyo' });        // 2026-03-08
```

Nobody's birthday has a time zone, and this one has acquired one. The
date-only string was parsed as UTC midnight, and UTC midnight is the previous
evening in every zone west of Greenwich.

The usual fix is to append `T00:00:00` and hope, or to store a string and parse
it at the last moment. Temporal's answer is different in kind: the value stops
being able to represent a moment at all.

```js
const pd = Temporal.PlainDate.from('2026-03-08');
pd.toString();          // 2026-03-08, in every zone
'timeZoneId' in pd;     // false
```

## Five types, because "a date" was five things

`Date` is a number of milliseconds with formatting methods bolted on, and every
program using it has silently picked one of several meanings. Temporal makes you
name the meaning up front. On Node 26.8.1:

```js
Object.getOwnPropertyNames(Temporal);
// Now, PlainDate, PlainTime, PlainDateTime, ZonedDateTime,
// Duration, Instant, PlainYearMonth, PlainMonthDay
```

Five of those are the ones a `Date` was pretending to be:

| Type | What it is | What it cannot answer |
|---|---|---|
| `Instant` | A fixed point on the timeline, no calendar | What day is it? |
| `ZonedDateTime` | An instant plus a zone, so both are known | — |
| `PlainDateTime` | Wall-clock date and time, no zone | Which instant is this? |
| `PlainDate` | A calendar day | What time? Where? |
| `PlainTime` | A time of day | Which day? |

The migration cost people report is not learning nine names. It is
discovering that a field they have been storing for years is two of these at
once, and that the code reading it disagrees with the code writing it about
which.

:::note
Temporal is a finished proposal and it is in Node 26.8.1 as a global with no
flag, but it is not in ES2026. TC39's finished-proposals table lists its expected
publication year as 2027, and the ES2026 spec text contains no occurrence of the
word. Runtimes ship Stage 4 features ahead of the edition; a migration guide that
says "ES2026" is describing the ecosystem, not the standard.
:::

## Adding a day and adding 24 hours are two operations

Take a meeting the day before US clocks spring forward, and move it to
"tomorrow":

```js
const d = new Date('2026-03-07T12:00:00-05:00');
new Date(d.getTime() + 24 * 60 * 60 * 1000)
  .toLocaleString('en-US', { timeZone: 'America/New_York' });
// 3/8/2026, 1:00:00 PM
```

The meeting moved an hour. `Date` has one kind of arithmetic — add milliseconds —
and 8 March in New York is 23 hours long, so a day expressed in milliseconds
overshoots. Every codebase with `+ 86400000` in it is wrong twice a year, in
opposite directions.

Temporal has both operations and different names for them:

```js
const zdt = Temporal.ZonedDateTime.from('2026-03-07T12:00:00-05:00[America/New_York]');
zdt.add({ days: 1 });    // 2026-03-08T12:00:00-04:00[America/New_York]
zdt.add({ hours: 24 });  // 2026-03-08T13:00:00-04:00[America/New_York]
```

Same wall clock on the next day, or the same elapsed time. Both are legitimate
and they answer different questions. The reason this feels like extra work is
that the question was always there; `Date` answered it for you, always the
same way, without asking.

## The midnight that does not exist

Beirut moves its clocks forward at midnight. On 29 March 2026, `00:00` in
`Asia/Beirut` is not a time that happens — the clock goes from `23:59:59` to
`01:00:00`.

`Date` has no way to say this. It parses the string in whatever zone the process
happens to be in and produces an instant with no complaint. Temporal treats it as
a question with four documented answers:

```js
const wall = Temporal.PlainDateTime.from('2026-03-29T00:00:00');
wall.toZonedDateTime('Asia/Beirut', { disambiguation: 'reject' });
// RangeError: Temporal error: Rejecting ambiguous time zones.
```

```
compatible   2026-03-29T01:00:00+03:00[Asia/Beirut]
earlier      2026-03-28T23:00:00+02:00[Asia/Beirut]
later        2026-03-29T01:00:00+03:00[Asia/Beirut]
```

The proposal's own text defines the modes: `'compatible'` (the default) "acts
like `'earlier'` for backward transitions and `'later'` for forward
transitions", `'earlier'` and `'later'` pick one of two possible exact times,
and `'reject'` throws a `RangeError`.

Look at what `earlier` returns. The midnight you asked for lands on **28 March**,
the day before the one you named. That is not a bug; it is the honest answer to
"give me the latest instant before the gap", and it is exactly the class of
result a scheduling system silently produces today and nobody notices until a
customer does.

## What this does and does not buy

The gain is that the three bugs above stop being runtime surprises and become
decisions made where the value is created. A birthday is a `PlainDate` and has
nowhere to shift to. A meeting is a `ZonedDateTime` and knows which arithmetic it
wants. An input with no zone is a `PlainDateTime` and cannot be compared to an
instant until someone supplies one.

The cost is real and it is not the API surface. It is that a codebase migrating
to Temporal has to answer, field by field, a question it has been deferring —
and the answer is often "this column has meant two different things since 2019".
No library fixes that. Temporal only stops you from continuing.

The shape of the fix is familiar from the type system. Splitting one type into
five so that the wrong combination cannot be written down is what
[narrowing does along a control flow path](/blog/type-level-narrowing-in-typescript/),
applied to a domain instead of to a union: the checker stops being able to
follow an argument you were making by accident.

Two recent additions to the language reward the same treatment and reward it in
opposite directions. Iterator helpers arrived quietly and turned out to have a
[different cost model than the array methods they resemble](/blog/iterator-helpers-are-lazy/);
Temporal arrives loudly and turns out to be a type system rather than a library.
In both cases the interesting part is the one the migration guides skip.

## What to check, and what I did not

Every example above ran on Node 26.8.1 with the zone named explicitly in the call
rather than inherited from the process, which is the habit worth copying — a test
that passes because your laptop is in one zone is not a test.

What I did not test: `Temporal.Duration` rounding and balancing, which is where I
expect the next set of surprises to live; the `PlainMonthDay` and
`PlainYearMonth` types, which have no `Date` equivalent at all; and serialization
round-trips through a database driver, where the question of which type a column
deserializes into is the whole migration in practice.
