Tomorrow at 9 AM or 24 Hours Later? A JavaScript Temporal Guide
DDEVELOPER
DeveloperPublished: 8 min read

Tomorrow at 9 AM or 24 Hours Later? A JavaScript Temporal Guide

A reminder that goes out every morning at 9 and a link that expires 24 hours after it is issued can sound like the same scheduling problem. In New York, when daylight saving time starts on Sunday, the interval from Saturday at 9 a.m. to Sunday at 9 a.m. is 23 hours. Add 24 hours to Saturday at 9 a.m. and you get 10 a.m. on Sunday.

JavaScript's Temporal API lets you say which operation you mean. We'll run both calculations across the spring and fall clock changes, then use the results to design reminders, booking forms, and expiry checks.

Japanese original published: 2026-12-05

Choose a type for the time you mean

Temporal.PlainDateTime represents a calendar date and a clock reading. “March 8 at 9 a.m.” fits this type when the time zone is still unspecified. Temporal.ZonedDateTime combines a specific instant with a time zone and a calendar. It lets you work out when 9 a.m. in New York occurs on the UTC timeline.

Temporal.Instant is a point on that timeline. It carries no display time zone, which makes it useful for comparing the instant a link was issued with its expiration deadline. An offset such as -05:00 tells you the difference from UTC at one moment. A named zone such as America/New_York gives you rules that determine the offset on other dates. IANA records those rules, and they can change.

New York's next 9 a.m. can be 23 or 25 hours away

On a ZonedDateTime, add({ days: 1 }) advances the local calendar date. It targets the same clock reading the next day and uses Temporal's rules to resolve any gap or overlap. add({ hours: 24 }) moves 24 elapsed hours along the timeline.

const start = Temporal.ZonedDateTime.from(
  "2026-03-07T09:00[America/New_York]"
);
console.log(start.add({ days: 1 }).toString());
// 2026-03-08T09:00:00-04:00[America/New_York]
console.log(start.add({ hours: 24 }).toString());
// 2026-03-08T10:00:00-04:00[America/New_York]
Figure 1. Next-day 9 a.m. and 24 hours later in New York

Spring · Start Mar 7, 09:00 (UTC−05:00)

  1. Next morning at 9
    Mar 8, 09:00 (23 hours elapsed)
  2. 24 hours later
    Mar 8, 10:00 (24 hours elapsed)

Fall · Start Oct 31, 09:00 (UTC−04:00)

  1. 24 hours later
    Nov 1, 08:00 (24 hours elapsed)
  2. Next morning at 9
    Nov 1, 09:00 (25 hours elapsed)

New York local time in 2026. Each pair is listed in time order. The spacing is schematic. NanToo results based on TC39: Temporal.ZonedDateTime and IANA: Time Zones.

In spring, the start is March 7 at 14:00 UTC and the next 9 a.m. is March 8 at 13:00 UTC, an elapsed time of 23 hours. In fall, the interval from October 31 at 13:00 UTC to November 1 at 14:00 UTC is 25 hours.

Try the same spring dates in Tokyo and both operations land on 9 a.m. the following day because the offset stays the same. Other regions use different clock changes. On Lord Howe Island (Australia/Lord_Howe), the October 2026 shift is 30 minutes. From October 3 at 9 a.m. to the next 9 a.m., 23 hours and 30 minutes elapse.

Handle skipped and repeated times in a booking form

The 9 a.m. examples each have a single match on the following day. On days when the clocks change, the time a customer enters may be skipped entirely or may occur twice.

Figure 2. A clock change can skip or repeat a local time

Spring gap · Mar 8 at 02:30
No match. The clock skips the 02:00 hour when it jumps to 03:00.

Fall overlap · Nov 1 at 01:30

  1. First occurrence
    01:30 at UTC−04:00 (05:30 UTC)
  2. Second occurrence
    01:30 at UTC−05:00 (06:30 UTC)

New York in 2026. NanToo results based on TC39: Time Zones and Resolving Ambiguity and IANA: Time Zones.

Pass disambiguation: "reject" to PlainDateTime.toZonedDateTime() to get a RangeError for either case. In a booking form, ask customers to choose a time that exists when the clocks move forward. For the fall overlap, show both 01:30 entries with their UTC offsets and let customers choose.

const local = Temporal.PlainDateTime.from("2026-11-01T01:30");
const zone = "America/New_York";
console.log(local.toZonedDateTime(zone, {
  disambiguation: "earlier"
}).toInstant().toString()); // 2026-11-01T05:30:00Z
console.log(local.toZonedDateTime(zone, {
  disambiguation: "later"
}).toInstant().toString()); // 2026-11-01T06:30:00Z

The default, "compatible", moves the skipped spring time forward to 03:30 and selects the first 01:30 in the fall. For the missing 02:30 in spring, "earlier" and "later" give the valid clock readings 01:30 and 03:30, respectively. If the form adjusts a booking automatically, show the resolved time before confirmation.

Test environment and scope

We ran the examples on a Mac with Node.js 24.22.3 and --harmony-temporal. The time zone database was 2026e, as reported by process.versions.tz. The tests covered New York in spring and fall, Tokyo as a control, all four disambiguation options for gaps and overlaps, recurring reminders, the expiry boundary, and Lord Howe's half-hour change.

Node.js 26 enables Temporal by default. In a browser or other runtime, check typeof globalThis.Temporal and the methods you need. Time zone rules depend on the runtime's database, so test actual booking dates on the versions you deploy.

References and sources

Editorial note

This article was prepared with AI assistance and reviewed by an editor before publication. It may still contain factual errors, interpretation mistakes, or outdated information. Check the cited primary sources or official documentation before making an important decision.

Related articles