Skip to main content
Temporal - Web documentation

Classes

c
Temporal.Duration
A `Temporal.Duration` represents an immutable duration of time which can be used in date/time arithmetic. See https://tc39.es/proposal-temporal/docs/duration.html for more details.
c
Temporal.Instant
A `Temporal.Instant` is an exact point in time, with a precision in nanoseconds. No time zone or calendar information is present. Therefore, `Temporal.Instant` has no concept of days, months, or even hours. For convenience of interoperability, it internally uses nanoseconds since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time) (midnight UTC on January 1, 1970). However, a `Temporal.Instant` can be created from any of several expressions that refer to a single point in time, including an [ISO 8601 string](https://en.wikipedia.org/wiki/ISO_8601) with a time zone offset such as '2020-01-23T17:04:36.491865121-08:00'. See https://tc39.es/proposal-temporal/docs/instant.html for more details.
c
Temporal.PlainDate
A `Temporal.PlainDate` represents a calendar date. "Calendar date" refers to the concept of a date as expressed in everyday usage, independent of any time zone. For example, it could be used to represent an event on a calendar which happens during the whole day no matter which time zone it's happening in. See https://tc39.es/proposal-temporal/docs/date.html for more details.
c
Temporal.PlainDateTime
A `Temporal.PlainDateTime` represents a calendar date and wall-clock time, with a precision in nanoseconds, and without any time zone. Of the Temporal classes carrying human-readable time information, it is the most general and complete one. `Temporal.PlainDate`, `Temporal.PlainTime`, `Temporal.PlainYearMonth`, and `Temporal.PlainMonthDay` all carry less information and should be used when complete information is not required. See https://tc39.es/proposal-temporal/docs/datetime.html for more details.
c
Temporal.PlainMonthDay
A `Temporal.PlainMonthDay` represents a particular day on the calendar, but without a year. For example, it could be used to represent a yearly recurring event, like "Bastille Day is on the 14th of July." See https://tc39.es/proposal-temporal/docs/monthday.html for more details.
c
Temporal.PlainTime
A `Temporal.PlainTime` represents a wall-clock time, with a precision in nanoseconds, and without any time zone. "Wall-clock time" refers to the concept of a time as expressed in everyday usage — the time that you read off the clock on the wall. For example, it could be used to represent an event that happens daily at a certain time, no matter what time zone. `Temporal.PlainTime` refers to a time with no associated calendar date; if you need to refer to a specific time on a specific day, use `Temporal.PlainDateTime`. A `Temporal.PlainTime` can be converted into a `Temporal.PlainDateTime` by combining it with a `Temporal.PlainDate` using the `toPlainDateTime()` method. See https://tc39.es/proposal-temporal/docs/time.html for more details.
c
Temporal.PlainYearMonth
A `Temporal.PlainYearMonth` represents a particular month on the calendar. For example, it could be used to represent a particular instance of a monthly recurring event, like "the June 2019 meeting". See https://tc39.es/proposal-temporal/docs/yearmonth.html for more details.

Interfaces

I
Temporal.DifferenceOptions
Options to control the result of `until()` and `since()` methods in `Temporal` types.
I
Temporal.DurationArithmeticOptions
Options to control behavior of `Duration.compare()`

Namespaces

N
Temporal
[Specification](https://tc39.es/proposal-temporal/docs/index.html)

Type Aliases

T
Temporal.ArithmeticOptions
Options for arithmetic operations like `add()` and `subtract()`
T
Temporal.AssignmentOptions
Options for assigning fields using `with()` or entire objects with `from()`.
T
Temporal.CalendarLike
Any of these types can be passed to Temporal methods instead of a calendar ID.
T
Temporal.CalendarTypeToStringOptions
No documentation available
T
Temporal.ComparisonResult
No documentation available
T
Temporal.DateTimeUnit
No documentation available
T
Temporal.DateUnit
No documentation available
T
Temporal.DurationOptions
Options for assigning fields using `Duration.prototype.with()` or entire objects with `Duration.from()`, and for arithmetic with `Duration.prototype.add()` and `Duration.prototype.subtract()`.
T
Temporal.DurationRoundTo
The `round` method of the `Temporal.Duration` accepts one required parameter. If a string is provided, the resulting `Temporal.Duration` object will be rounded to that unit. If an object is provided, the `smallestUnit` and/or `largestUnit` property is required, while other properties are optional. A string parameter is treated the same as an object whose `smallestUnit` property value is that string.
T
Temporal.DurationTotalOf
Options to control behavior of `Duration.prototype.total()`
T
Temporal.InstantToStringOptions
No documentation available
T
Temporal.LargestUnit
No documentation available
T
Temporal.OffsetDisambiguationOptions
No documentation available
T
Temporal.PluralUnit
When the name of a unit is provided to a Temporal API as a string, it is usually singular, e.g. 'day' or 'hour'. But plural unit names like 'days' or 'hours' are also accepted.
T
Temporal.RoundingMode
No documentation available
T
Temporal.RoundTo
`round` methods take one required parameter. If a string is provided, the resulting `Temporal.Duration` object will be rounded to that unit. If an object is provided, its `smallestUnit` property is required while other properties are optional. A string is treated the same as an object whose `smallestUnit` property value is that string.
T
Temporal.ShowCalendarOption
No documentation available
T
Temporal.SmallestUnit
No documentation available
T
Temporal.TimeUnit
No documentation available
T
Temporal.TimeZoneLike
Any of these types can be passed to Temporal methods instead of a time zone ID.
T
Temporal.ToInstantOptions
Options for conversions of `Temporal.PlainDateTime` to `Temporal.Instant`
T
Temporal.ToStringPrecisionOptions
Options for outputting precision in toString() on types with seconds
T
Temporal.TotalUnit
No documentation available
T
Temporal.TransitionDirection
Options to control behaviour of `ZonedDateTime.prototype.getTimeZoneTransition()`
T
Temporal.ZonedDateTimeAssignmentOptions
No documentation available
T
Temporal.ZonedDateTimeToStringOptions
No documentation available

Variables

v
Temporal.Now
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.