Temporal.Instant.from()

Limited availability

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

The Temporal.Instant.from() static method creates a new Temporal.Instant object from another Temporal.Instant object, or an RFC 9557 string.

Syntax

js
Temporal.Instant.from(info)

Parameters

info

One of the following:

  • A Temporal.Instant instance, which creates a copy of the instance.
  • An RFC 9557 string containing a date, time, and time zone offset. The time zone name is ignored; only the offset is used.

Return value

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

Exceptions

TypeError

Thrown if info is not a Temporal.Instant instance or a string.

RangeError

Thrown in one of the following cases:

  • The string is not a valid RFC 9557 string.
  • The info is not in the representable range, which is ±108 days, or about ±273,972.6 years, from the Unix epoch.

Examples

Creating an instant from a string

js
const instant = Temporal.Instant.from("1970-01-01T00Z");
console.log(instant.toString()); // 1970-01-01T00:00:00Z

const instant2 = Temporal.Instant.from("1970-01-01T00+08:00");
console.log(instant2.toString()); // 1969-12-31T16:00:00Z

// America/New_York is UTC-5 in January 1970, not UTC+8
const instant3 = Temporal.Instant.from("1970-01-01T00+08:00[America/New_York]");
console.log(instant3.toString()); // 1969-12-31T16:00:00Z; the time zone name is ignored

Creating an instant from another instant

js
const instant = Temporal.Instant.from("1970-01-01T00Z");
const instant2 = Temporal.Instant.from(instant);
console.log(instant2.toString()); // 1970-01-01T00:00:00Z

Specifications

Specification
Temporal
# sec-temporal.instant.from

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
from
Chrome – Full support
Chrome 144 (Release date: 2026-01-13)
footnote Full support
Edge – Full support
Edge 144 (Release date: 2026-01-21)
footnote Full support
Firefox – Full support
Firefox 139 (Release date: 2025-05-27)
footnote Full support
Opera – Full support
Opera 128 (Release date: 2026-02-26)
footnote Full support
Safari – Preview support
Safari TP
footnote
footnote See bug 223166
footnote Preview browser support
Chrome Android – Full support
Chrome Android 144 (Release date: 2026-01-13)
footnote Full support
Firefox for Android – Full support
Firefox for Android 139 (Release date: 2025-05-27)
footnote Full support
Opera Android – Full support
Opera Android 95 (Release date: 2026-02-11)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – Full support
WebView Android 144 (Release date: 2026-01-13)
footnote Full support
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
See implementation notes.

See also