Getting the Current Time with Temporal.Now

How to read the current instant, wall-clock time, and civil date with Temporal.Now, and why new Date() gives the wrong day off-box. Part of Modern Temporal API.

Problem framing

"Now" is not a single value — it is an instant, and separately a set of wall-clock fields that only exist once you name a time zone. Legacy new Date() blurs the two: it captures the instant but exposes it through the host machine's zone, so the same code reports a different calendar day on a server in Los Angeles and a browser in Tokyo. Temporal.Now splits the concept into precise methods, forcing you to say whether you want the absolute instant or the current wall-clock reading in a named zone.

Ask for exactly the 'now' you meannew Date() couples the instant to the host zoneAsk for exactly the 'now' you meannew Date() then getHours()host-zone wall clockTemporal.Now.plainDateTimeISO(zone)explicit zoneTemporal.Now separates the absolute instant from a zoned wall-clock reading.

API reference

Temporal.Now is a namespace of read-only clocks. Each returns the current moment as a different type.

Temporal.Now methodsOne clock, several views of the presentTemporal.Now methodsTemporal.Now.instant()absolute instant, ns precisionTemporal.Now.zonedDateTimeISO(tz)instant + zone = wall clockTemporal.Now.plainDateISO(tz)today's civil date in a zoneTemporal.Now.timeZoneId()the host's IANA zone id

Approach A: legacy Date

Legacy code reads the clock with Date.now() (epoch ms) or new Date() (an instant viewed through the host zone). There is no way to ask for "today in Tokyo" without constructing a formatter.

const nowMs = Date.now();              // absolute, fine
const today = new Date().getDate();    // host-zone day — wrong off-box

Reading 'now' the legacy wayDate.now() is fine for instants; field getters leak the host zoneLegacyModernDate.now() → epoch msnew Date().getDate()host-zone dayno per-zone 'today'Temporal.Now.instant()plainDateISO('Asia/Tokyo')explicit zoneexact 'today' anywhere

Approach B: Temporal.Now

Name the zone and Temporal returns the correct wall-clock present.

import { Temporal } from '@js-temporal/polyfill';
const instant = Temporal.Now.instant();                       // absolute
const tokyoNow = Temporal.Now.zonedDateTimeISO('Asia/Tokyo');  // wall clock in Tokyo
const tokyoToday = Temporal.Now.plainDateISO('Asia/Tokyo');    // civil date in Tokyo

Pick the present you needInstant for logging, zoned for display, plain date for 'today'Pick the present you needNow.instant()zonedDateTimeISO(tz)plainDateISO(tz)

Production implementation

Inject the clock so code is testable rather than reading Temporal.Now directly everywhere.

import { Temporal } from '@js-temporal/polyfill';
export interface Clock { now(): Temporal.Instant; today(tz: string): Temporal.PlainDate; }
export const systemClock: Clock = {
  now: () => Temporal.Now.instant(),
  today: (tz) => Temporal.Now.plainDateISO(tz),
};
// Pass a fixed Clock in tests for deterministic results.

Inject the clockA Clock interface makes 'now' swappable in testsInject the clockClock ifacesystemClockinjectfixed in tests

Edge cases

Now() edge casesZone assumptions, resolution, and monotonicityNow() edge casesHost zonetimeZoneId()may be UTC on serversResolutionns availableclock may be coarserNot monotonicwall clock can jumpuse performance.now

Gotchas & common pitfalls

Now() pitfallsAssuming the host zone and using wall time for durationsWrongRightnew Date().getDate() on serverUTC day, not user'splainDateISO(userZone)correct 'today'subtract two Date.now() for perfwall clock can jumpperformance.now() for timingmonotonic

Testing checklist

Now() test matrixInjected clock yields deterministic resultsAssertions that prove the edge casefixed Clock.now()frozen instanttoday('Asia/Tokyo')expected datehost UTC vs Tokyodifferent daytimeZoneId()IANA string

Frequently Asked Questions

How do I get the current date in a specific time zone with Temporal?

Call Temporal.Now.plainDateISO(timeZone) with an IANA id such as 'Asia/Tokyo'. It returns today's civil date in that zone, which can differ from the server's date, so it is the reliable way to compute 'today' for a user in another region.

Is Temporal.Now.instant() suitable for measuring elapsed time?

No. Like Date.now() it reads the wall clock, which can jump when the system time is adjusted. For measuring durations use performance.now(), which is monotonic; use Temporal.Now.instant() for timestamps that represent an actual moment.

How do I make code that reads the current time testable?

Wrap Temporal.Now behind a small Clock interface and inject it. Production wires the system clock; tests pass a clock that returns a fixed instant, so time-dependent logic becomes deterministic without monkey-patching globals.