Temporal.ZonedDateTime()

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Temporal.ZonedDateTime() constructor creates Temporal.ZonedDateTime objects.

This constructor allows you to create instances by directly supplying the underlying data. Like all other Temporal classes, you should usually construct Temporal.ZonedDateTime objects using the Temporal.ZonedDateTime.from() static method, which can handle a variety of input types.

Syntax

js
new Temporal.ZonedDateTime(epochNanoseconds, timeZone)
new Temporal.ZonedDateTime(epochNanoseconds, timeZone, calendar)

Note: Temporal.ZonedDateTime() can only be constructed with new. Attempting to call it without new throws a TypeError.

Parameters

epochNanoseconds

A BigInt that corresponds to the epochNanoseconds property.

timeZone

A string that corresponds to the timeZoneId property. Unlike all other Temporal APIs, it must be a valid time zone identifier (either named or offset) as-is, and cannot be a Temporal.ZonedDateTime instance or a date-time string.

calendar Optional

A string that corresponds to the calendarId property. See Intl.supportedValuesOf() for a list of commonly supported calendar types. Defaults to "iso8601".

Return value

A new Temporal.ZonedDateTime object, representing the specific instant specified by the parameters.

Exceptions

TypeError

Thrown if timeZone or calendar is not a string.

RangeError

Thrown in one of the following cases:

  • epochNanoseconds is not in the representable range, which is ±108 days, or about ±273,972.6 years, from the Unix epoch.
  • timeZone is not a valid time zone identifier.
  • calendar is not a valid calendar identifier.

Examples

Using Temporal.ZonedDateTime()

js
const zdt = new Temporal.ZonedDateTime(0n, "America/New_York");
console.log(zdt.toString()); // '1969-12-31T19:00:00-05:00[America/New_York]'

Specifications

Specification
Temporal
# sec-temporal-zoneddatetime-constructor

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
ZonedDateTime() constructor
Experimental
Chrome – No support
Chrome
footnote
footnote See bug 401065166
Edge – No support
Edge
footnote
footnote See bug 401065166
Firefox – Full support
Firefox 139 (Release date: 2025-05-27)
footnote Full support
Opera – No support
Opera
footnote
footnote See bug 401065166
Safari – No support
Safari
footnote
footnote See bug 223166
Chrome Android – No support
Chrome Android
footnote
footnote See bug 401065166
Firefox for Android – Full support
Firefox for Android 139 (Release date: 2025-05-27)
footnote Full support
Opera Android – No support
Opera Android
footnote
footnote See bug 401065166
Safari on iOS – No support
Safari on iOS
footnote
footnote See bug 223166
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 401065166
WebView Android – No support
WebView Android
footnote
footnote See bug 401065166
WebView on iOS – No support
WebView on iOS
footnote
footnote See bug 223166
Bun – No support
Bun
footnote No support
Deno – Full support
Deno 2.7 (Release date: 2026-02-25)
footnote Full support
Node.js – No support
Node.js
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

See also