Temporal.Instant()

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.Instant() constructor creates Temporal.Instant objects.

This constructor is exactly equivalent to calling Temporal.Instant.fromEpochNanoseconds().

Syntax

js
new Temporal.Instant(epochNanoseconds)

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

Parameters

epochNanoseconds

A BigInt representing the number of nanoseconds since the Unix epoch.

Return value

A new Temporal.Instant object representing the instant in time specified by epochNanoseconds.

Exceptions

RangeError

Thrown if epochNanoseconds represents an instant outside the range of representable instants, which is ±108 days, or about ±273,972.6 years, from the Unix epoch.

Examples

Using Temporal.Instant()

js
const instant = new Temporal.Instant(0n);
console.log(instant.toString()); // 1970-01-01T00:00:00Z
const vostok1Liftoff = new Temporal.Instant(-275248380000000000n);
console.log(vostok1Liftoff.toString()); // 1961-04-12T06:07:00Z
const sts1Liftoff = new Temporal.Instant(355924804000000000n);
console.log(sts1Liftoff.toString()); // 1981-04-12T12:00:04Z

Specifications

Specification
Temporal
# sec-temporal-instant-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
Instant() 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 – Preview support
Safari TP
footnote
footnote See bug 223166
footnote Preview browser support
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 No support
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 No support
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
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

See also