Skip to main content
Temporal.Now - Temporal - Web documentation
variable Temporal.Now
Unstable

The Temporal.Now object has several methods which give information about the current date, time, and time zone.

See https://tc39.es/proposal-temporal/docs/now.html for more details.

Properties

Get the exact system date and time as a Temporal.Instant.

This method gets the current exact system time, without regard to calendar or time zone. This is a good way to get a timestamp for an event, for example. It works like the old-style JavaScript Date.now(), but with nanosecond precision instead of milliseconds.

Note that a Temporal.Instant doesn't know about time zones. For the exact time in a specific time zone, use Temporal.Now.zonedDateTimeISO or Temporal.Now.zonedDateTime.

Get the current calendar date and clock time in a specific time zone, using the ISO 8601 calendar.

Get the current date and clock time in a specific time zone, using the ISO 8601 calendar.

Note that the Temporal.PlainDateTime type does not persist the time zone, but retaining the time zone is required for most time-zone-related use cases. Therefore, it's usually recommended to use Temporal.Now.zonedDateTimeISO instead of this function.

Get the current date in a specific time zone, using the ISO 8601 calendar.

Get the current clock time in a specific time zone, using the ISO 8601 calendar.

timeZoneId: () => string

Get the identifier of the environment's current time zone.

This method gets the identifier of the current system time zone. This will usually be a named IANA time zone.

readonly
[[Symbol.toStringTag]]: "Temporal.Now"