Temporal.Now - 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 calendar and time zone.

The calendar parameter is required. When using the ISO 8601 calendar or if you don't understand the need for or implications of a calendar, then a more ergonomic alternative to this method is Temporal.Now.zonedDateTimeISO().

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

Get the current calendar date and clock time in a specific calendar and time zone.

The calendar is required. When using the ISO 8601 calendar or if you don't understand the need for or implications of a calendar, then a more ergonomic alternative to this method is Temporal.Now.plainDateTimeISO.

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 or Temporal.Now.zonedDateTime instead of this function.

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 calendar date in a specific calendar and time zone.

The calendar is required. When using the ISO 8601 calendar or if you don't understand the need for or implications of a calendar, then a more ergonomic alternative to this method is Temporal.Now.plainDateISO.

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"