?um/p1-90`The following
Time measurement in ECMAScript is analogous to time measurement in POSIX, in particular sharing definition in terms of the proleptic Gregorian calendar, an epoch of midnight at the beginning of 1 January 1970 UTC, and an accounting of every day as comprising exactly 86,400 seconds (each of which is 1000 milliseconds long).
An ECMAScript time value
Time values do not account for UTC leap seconds—there are no time values representing instants within positive leap seconds, and there are time values representing instants removed from the UTC timeline by negative leap seconds. However, the definition of time values nonetheless yields piecewise alignment with UTC, with discontinuities only at leap second boundaries and zero difference outside of leap seconds.
A Number can exactly represent all
The exact moment of midnight at the beginning of 1 January 1970 UTC is represented by the time value
In the proleptic Gregorian calendar, leap years are precisely those which are both divisible by 4 and either divisible by 400 or not divisible by 100.
The 400 year cycle of the proleptic Gregorian calendar contains 97 leap years. This yields an average of 365.2425 days per year, which is 31,556,952,000 milliseconds. Therefore, the maximum range a Number could represent exactly with millisecond precision is approximately -285,426 to 285,426 years relative to 1970. The smaller range supported by a time value as specified in this section is approximately -273,790 to 273,790 years relative to 1970.
These constants are referenced by algorithms in the following sections.
The abstract operation Day takes argument t (a
The abstract operation TimeWithinDay takes argument t (a
The abstract operation DaysInYear takes argument y (an
The abstract operation DayFromYear takes argument y (an
The abstract operation TimeFromYear takes argument y (an
The abstract operation YearFromTime takes argument t (a
The abstract operation DayWithinYear takes argument t (a
The abstract operation InLeapYear takes argument t (a
The abstract operation MonthFromTime takes argument t (a
The abstract operation DateFromTime takes argument t (a
The abstract operation WeekDay takes argument t (a
The abstract operation HourFromTime takes argument t (a
The abstract operation MinFromTime takes argument t (a
The abstract operation SecFromTime takes argument t (a
The abstract operation msFromTime takes argument t (a
The abstract operation GetUTCEpochNanoseconds takes argument isoDateTime (an
The abstract operation LocalTime takes argument t (a
If political rules for the local time t are not available within the implementation, the result is t because
It is required for
Two different input
The abstract operation UTC takes argument t (a Number) and returns a
Input t is nominally a
If political rules for the local time t are not available within the implementation, the result is t because
It is required for
1:30 AM on 5 November 2017 in America/New_York is repeated twice (fall backward), but it must be interpreted as 1:30 AM UTC-04 instead of 1:30 AM UTC-05.
In UTC(
2:30 AM on 12 March 2017 in America/New_York does not exist, but it must be interpreted as 2:30 AM UTC-05 (equivalent to 3:30 AM UTC-04).
In UTC(
The abstract operation MakeTime takes arguments hour (a Number), min (a Number), sec (a Number), and ms (a Number) and returns a Number. It calculates a number of milliseconds. It performs the following steps when called:
The arithmetic in MakeTime is floating-point arithmetic, which is not associative, so the operations must be performed in the correct order.
The abstract operation MakeDay takes arguments year (a Number), month (a Number), and date (a Number) and returns a Number. It calculates a number of days. It performs the following steps when called:
The abstract operation MakeDate takes arguments day (a Number) and time (a Number) and returns a Number. It calculates a number of milliseconds. It performs the following steps when called:
The abstract operation MakeFullYear takes argument year (a Number) and returns an
The abstract operation TimeClip takes argument time (a Number) and returns a Number. It calculates a number of milliseconds. It performs the following steps when called:
ECMAScript defines a string interchange format for date-times which is adapted from the ISO 8601 calendar date extended format. The format is as follows: YYYY-MM-DDTHH:mm:ss.sssZ
Where the elements are as follows:
YYYY
|
is the year in the proleptic Gregorian calendar as four decimal digits from 0000 to 9999, or as an |
-
|
|
MM
|
is the month of the year as two decimal digits from 01 (January) to 12 (December). |
DD
|
is the day of the month as two decimal digits from 01 to 31. |
T
|
|
HH
|
is the number of complete hours that have passed since midnight as two decimal digits from 00 to 24. |
:
|
|
mm
|
is the number of complete minutes since the start of the hour as two decimal digits from 00 to 59. |
ss
|
is the number of complete seconds since the start of the minute as two decimal digits from 00 to 59. |
.
|
|
sss
|
is the number of complete milliseconds since the start of the second as three decimal digits. |
Z
|
is the UTC offset representation specified as HH:mm (a subset of the |
This format includes date-only forms:
YYYY
YYYY-MM
YYYY-MM-DD
It also includes “date-time” forms that consist of one of the above date-only forms immediately followed by one of the following time forms with an optional UTC offset representation appended:
THH:mm
THH:mm:ss
THH:mm:ss.sss
A string containing out-of-bounds or nonconforming elements is not a valid instance of this format.
As every day both starts and ends with midnight, the two notations 00:00 and 24:00 are available to distinguish the two midnights that can be associated with one date. This means that the following two notations refer to exactly the same point in time: 1995-02-04T24:00 and 1995-02-05T00:00.
This format does not support annotations with a time zone name as defined in RFC 9557, only a numeric representation of the time zone offset. For strings with a time zone annotation, see
Covering the full Date.parse
Examples of date-
| -271821-04-20T00:00:00Z | 271822 B.C. |
| -000001-01-01T00:00:00Z | 2 B.C. |
| +000000-01-01T00:00:00Z | 1 B.C. |
| +000001-01-01T00:00:00Z | 1 A.D. |
| +001970-01-01T00:00:00Z | 1970 A.D. |
| +002009-12-15T00:00:00Z | 2009 A.D. |
| +275760-09-13T00:00:00Z | 275760 A.D. |
ECMAScript defines string interchange formats for UTC offsets, derived from ISO 8601.
UTC offsets that represent
These formats are described by the grammar in
The abstract operation IsOffsetTimeZoneIdentifier takes argument offsetString (a String) and returns a Boolean. The return value indicates whether offsetString conforms to the grammar given by
The abstract operation ParseDateTimeUTCOffset takes argument offsetString (a String) and returns either a
The
An implementation of HostSystemUTCEpochNanoseconds must conform to the following requirements:
This requirement is necessary if the system clock is set to a time outside the range that
The default implementation of HostSystemUTCEpochNanoseconds performs the following steps when called:
ECMAScript
The abstract operation SystemUTCEpochMilliseconds takes no arguments and returns an
The Date
extends clause of a class definition. Subclass super call to the Date This function performs the following steps when called:
parse method (The Date
This function performs the following steps when called:
This function applies the
If the String conforms to the MM or DD elements are absent, HH, mm, or ss elements are absent, sss element is absent,
If x is any Date whose milliseconds amount is zero within a particular implementation of ECMAScript, then all of the following expressions should produce the same numeric value in that implementation, if all the properties referenced have their initial values:
x.valueOf()
Date.parse(x.toString())
Date.parse(x.toUTCString())
Date.parse(x.toISOString())
However, the expression
Date.parse(x.toLocaleString())
is not required to produce the same Number value as the preceding three expressions and, in general, the value produced by this function is toString or toUTCString method.
The initial value of Date.prototype is the
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
The
This function differs from the Date
The Date prototype object:
Unless explicitly defined otherwise, the methods of the Date prototype object defined below are not generic and the
The initial value of Date.prototype.constructor is
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
The
If month is not present, this method behaves as if month was present with the value getMonth(). If date is not present, it behaves as if date was present with the value getDate().
This method performs the following steps when called:
The
If min is not present, this method behaves as if min was present with the value getMinutes(). If sec is not present, it behaves as if sec was present with the value getSeconds(). If ms is not present, it behaves as if ms was present with the value getMilliseconds().
This method performs the following steps when called:
This method performs the following steps when called:
The
If sec is not present, this method behaves as if sec was present with the value getSeconds(). If ms is not present, this behaves as if ms was present with the value getMilliseconds().
This method performs the following steps when called:
The
If date is not present, this method behaves as if date was present with the value getDate().
This method performs the following steps when called:
The
If ms is not present, this method behaves as if ms was present with the value getMilliseconds().
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
The
If month is not present, this method behaves as if month was present with the value getUTCMonth(). If date is not present, it behaves as if date was present with the value getUTCDate().
This method performs the following steps when called:
The
If min is not present, this method behaves as if min was present with the value getUTCMinutes(). If sec is not present, it behaves as if sec was present with the value getUTCSeconds(). If ms is not present, it behaves as if ms was present with the value getUTCMilliseconds().
This method performs the following steps when called:
This method performs the following steps when called:
The
If sec is not present, this method behaves as if sec was present with the value getUTCSeconds(). If ms is not present, it behaves as if ms was present with the value return by getUTCMilliseconds().
This method performs the following steps when called:
The
If date is not present, this method behaves as if date was present with the value getUTCDate().
This method performs the following steps when called:
The
If ms is not present, this method behaves as if ms was present with the value getUTCMilliseconds().
This method performs the following steps when called:
This method performs the following steps when called:
This method provides a String representation of a Date for use by JSON.stringify (
It performs the following steps when called:
The argument is ignored.
This method is intentionally generic; it does not require that its toISOString method.
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:
This method returns a String value. The contents of the String are
The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:
This method returns a String value. The contents of the String are
The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:
This method returns a String value. The contents of the String are
The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
For any Date d such that d.[[DateValue]] is evenly divisible by 1000, the result of Date.parse(d.toString()) = d.valueOf(). See
This method is not generic; it throws a
The abstract operation TimeString takes argument tv (a Number, but not
The abstract operation DateString takes argument tv (a Number, but not
| Number | Name |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Number | Name |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The abstract operation TimeZoneString takes argument tv (an
The abstract operation ToDateString takes argument tv (an
This method performs the following steps when called:
This method performs the following steps when called:
This method returns a String value representing the instant in time corresponding to the
It performs the following steps when called:
This method performs the following steps when called:
This method is called by ECMAScript language operators to convert a Date to a primitive value. The allowed values for hint are
It performs the following steps when called:
This property has the attributes { [[Writable]]:
The value of the
Date instances are
Time zones in ECMAScript are represented by time zone identifiers, which are Strings composed entirely of code units in the
A primary time zone identifier is the preferred identifier for an available named time zone. A non-primary time zone identifier is an identifier for an available named time zone that is not a primary time zone identifier. An available named time zone identifier is either a primary time zone identifier or a non-primary time zone identifier. Each available named time zone identifier is associated with exactly one available named time zone. Each available named time zone is associated with exactly one primary time zone identifier and zero or more non-primary time zone identifiers.
An available time zone identifier is either an available named time zone identifier or an offset time zone identifier.
Time zone identifiers are compared using
ECMAScript implementations must support an available named time zone with the identifier
Implementations that follow the requirements for time zones as described in the ECMA-402 Internationalization API specification are called time zone aware.
Time zone aware implementations must support available named time zones corresponding to the Zone and
These identifiers are described by the grammar in
The
When the input represents a local time occurring more than once because of a negative time zone transition (e.g. when daylight saving time ends or the time zone offset is decreased due to a time zone rule change), the returned
The default implementation of GetNamedTimeZoneEpochNanoseconds, to be used for ECMAScript implementations that do not include local political rules for any time zones, performs the following steps when called:
It is required for
1:30 AM on 5 November 2017 in America/New_York is repeated twice, so GetNamedTimeZoneEpochNanoseconds for that time zone and ISO date-time would return a
2:30 AM on 12 March 2017 in America/New_York does not exist, so GetNamedTimeZoneEpochNanoseconds for that time zone and ISO date-time would return an empty
The
The returned
The default implementation of GetNamedTimeZoneOffsetNanoseconds, to be used for ECMAScript implementations that do not include local political rules for any time zones, performs the following steps when called:
Time zone offset values may be positive or negative.
The
The returned value t represents the number of nanoseconds since the
A transition is a point in time where the UTC offset of a time zone changes, for example when Daylight Saving Time starts or stops.
The returned value t represents the first nanosecond where the new UTC offset is used in this time zone, not the last nanosecond where the previous UTC offset is used.
In other words,
Given the same values of timeZoneIdentifier and epochNanoseconds, the result must be the same for the lifetime of the
The minimum implementation of GetNamedTimeZoneNextTransition for ECMAScript implementations that do not include local political rules for any time zones performs the following steps when called:
The
The returned value t represents the number of nanoseconds since the
A transition is a point in time where the UTC offset of a time zone changes, for example when Daylight Saving Time starts or stops.
The returned value t represents the first nanosecond where the new UTC offset is used in this time zone, not the last nanosecond where the previous UTC offset is used.
In other words,
Given the same values of timeZoneIdentifier and epochNanoseconds, the result must be the same for the lifetime of the
The minimum implementation of GetNamedTimeZonePreviousTransition for ECMAScript implementations that do not include local political rules for any time zones performs the following steps when called:
A Time Zone Identifier Record is a
Time Zone Identifier Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Identifier]] | a String | An |
| [[PrimaryIdentifier]] | a String | The |
If [[Identifier]] is a
The
The
To ensure the level of functionality that implementations commonly provide in the methods of the Date object, it is recommended that SystemTimeZoneIdentifier return an IANA time zone name corresponding to the
For example, if the
The abstract operation GetAvailableNamedTimeZoneIdentifier takes argument timeZoneIdentifier (a named
For any timeZoneIdentifier, or any value that is an
Furthermore,
Due to the complexity of supporting these requirements, it is recommended that the result of
The abstract operation ToTemporalTimeZoneIdentifier takes argument temporalTimeZoneLike (an ECMAScript value) and returns either a
The abstract operation GetOffsetNanosecondsFor takes arguments timeZone (an
The abstract operation GetISODateTimeFor takes arguments timeZone (an
The abstract operation GetEpochNanosecondsFor takes arguments timeZone (an
It performs the following steps when called:
The abstract operation DisambiguatePossibleEpochNanoseconds takes arguments possibleEpochNs (a
The abstract operation GetPossibleEpochNanoseconds takes arguments timeZone (an
The abstract operation GetStartOfDay takes arguments timeZone (an
The abstract operation TimeZoneEquals takes arguments one (an
A Calendar Date Record is a
Calendar Date Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Era]] | a String or |
A lowercase String representing the date's era, or |
| [[EraYear]] | an |
The ordinal position of the date's year within its era, or
Era years are 1-indexed for many calendars, but not all (e.g., the eras of the Burmese calendar, not currently available in CLDR, each start with a year 0). Years can also advance opposite the flow of time (as for BCE years in the Gregorian calendar).
|
| [[Year]] | an |
The date's year relative to the first day of a calendar-specific " |
| [[Month]] | a positive |
The 1-based ordinal position of the date's month within its year.
When the number of months in a year of the calendar is variable, a different value can be returned for dates that are part of the same month in different years. For example, in the Hebrew calendar, 1 Nisan 5781 is associated with value 7 while 1 Nisan 5782 is associated with value 8 because 5782 is a leap year and Nisan follows the insertion of Adar I.
|
| [[MonthCode]] | a |
The |
| [[Day]] | a positive |
The 1-based ordinal position of the date's day within its month. |
| [[DayOfWeek]] | a positive |
The day of the week corresponding to the date. The value should be 1-based, where 1 is the day corresponding to Monday in the given calendar. |
| [[DayOfYear]] | a positive |
The 1-based ordinal position of the date's day within its year. |
| [[WeekOfYear]] | a |
The date's calendar week of year, and the corresponding week calendar year. The The
Usually the The |
| [[DaysInWeek]] | a positive |
The number of days in the date's week. |
| [[DaysInMonth]] | a positive |
The number of days in the date's month. |
| [[DaysInYear]] | a positive |
The number of days in the date's year. |
| [[MonthsInYear]] | a positive |
The number of months in the date's year. |
| [[InLeapYear]] | a Boolean |
A "leap year" is a year that contains more days than other years (for solar or lunar calendars) or more months than other years (for lunisolar calendars like Hebrew or Chinese).
Some calendars, especially lunisolar ones, have further variation in year length that is not represented in the output of this operation (e.g., the Hebrew calendar includes common years with 353, 354, or 355 days and leap years with 383, 384, or 385 days).
|
A Calendar Fields Record is a
Many of the fields in a Calendar Fields Record have the same meaning as the fields of the same name in
Each field has a corresponding Temporal.PlainDate.prototype.with().
Each field has a corresponding enumeration key.
Calendar Fields Records have the fields listed in
| Field Name | Value | Default | Property Key | Enumeration Key | Conversion | Meaning |
|---|---|---|---|---|---|---|
| [[Era]] | a String or |
A lowercase String representing the era. | ||||
| [[EraYear]] | an |
The ordinal position of the year within the era. | ||||
| [[Year]] | an |
The year relative to the first day of a calendar-specific " |
||||
| [[Month]] | a positive |
The 1-based ordinal position of the month within the year. | ||||
| [[MonthCode]] | a |
The |
||||
| [[Day]] | a positive |
The 1-based ordinal position of the day within the month. | ||||
| [[Hour]] | an |
0 | The number of the hour within the day. | |||
| [[Minute]] | an |
0 | The number of the minute within the hour. | |||
| [[Second]] | an |
0 | The number of the second within the minute. | |||
| [[Millisecond]] | an |
0 | The number of the millisecond within the second. | |||
| [[Microsecond]] | an |
0 | The number of the microsecond within the millisecond. | |||
| [[Nanosecond]] | an |
0 | The number of the nanosecond within the microsecond. | |||
| [[OffsetString]] | a String or |
A string of the form ±HH:MM[:SS.SSSSSSSSS] that can be parsed by |
||||
| [[TimeZone]] | a String or |
An |
The abstract operation PrepareCalendarFields takes arguments calendar (a
The abstract operation CalendarFieldKeysPresent takes argument fields (a
The abstract operation CalendarMergeFields takes arguments calendar (a
At a minimum, ECMAScript implementations must support a built-in calendar named
ECMAScript implementations identify built-in calendars using a calendar type that is a Unicode Calendar Identifier as defined in Unicode Technical Standard #35 Part 1 Core, Key and Type Definitions. Their canonical form is a string containing only Unicode Basic Latin lowercase letters (U+0061 LATIN SMALL LETTER A through U+007A LATIN SMALL LETTER Z, inclusive) and/or digits (U+0030 DIGIT ZERO through U+0039 DIGIT NINE, inclusive), with zero or more medial hyphens (U+002D HYPHEN-MINUS).
The
The default implementation of AvailableCalendars, to be used for ECMAScript implementations that do not support any
The abstract operation CanonicalizeCalendar takes argument id (a String) and returns either a
The default implementation of CanonicalizeCalendar, to be used for ECMAScript implementations that do not support any
The abstract operation ToTemporalCalendarIdentifier takes argument temporalCalendarLike (an ECMAScript value) and returns either a
The abstract operation GetTemporalCalendarIdentifierWithISODefault takes argument item (an Object) and returns either a calendar property on the given item and converts its value into a calendar identifier.
If no such property is present, the built-in ISO 8601 calendar is returned.
It performs the following steps when called:
The abstract operation CalendarEquals takes arguments one (a
The abstract operation CalendarDateAdd takes arguments calendar (a
The
The abstract operation CalendarDateUntil takes arguments calendar (a
The
The abstract operation CalendarDateToISO takes arguments calendar (a
The
Like
The abstract operation CalendarMonthDayToISOReferenceDate takes arguments calendar (a
The fields of the returned
Like
Also like
The
The fields of the returned
The reference year is almost always 1972 (the first ISO 8601 leap year after the
Like
Also like
The operation throws a
The abstract operation CalendarISOToDate takes arguments calendar (a
Implementations are encouraged to elide fields that are not read by the caller.
The
Implementations are encouraged to elide fields that are not read by the caller.
The
The abstract operation CalendarFieldKeysToIgnore takes arguments calendar (a
The
This operation is relevant for calendars which accept fields other than the standard set of ISO 8601 calendar fields, in order to implement the Temporal objects' with() methods in such a way that the result is free of ambiguity or conflicts.
For example, given a calendar that uses eras, such as with() method might conflict with either of the other two properties on the receiver object, so those properties of the receiver object should be ignored.
Given this, in addition to the ISO 8601 mutual exclusion of
| keys | Returned |
|---|---|
| « |
« |
| « |
« |
| « |
« |
| « |
« |
| « |
« |
| « |
« |
| « |
« |
The abstract operation CalendarResolveFields takes arguments calendar (a
The
The operation throws a
When the fields of fields are inconsistent with respect to a non-
The abstract operation CalendarDateFromFields takes arguments calendar (a
The abstract operation CalendarYearMonthFromFields takes arguments calendar (a
The abstract operation CalendarMonthDayFromFields takes arguments calendar (a
A Date Duration Record is a
Date Duration Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Years]] | a |
The number of years in the duration. |
| [[Months]] | a |
The number of months in the duration. |
| [[Weeks]] | a |
The number of weeks in the duration. |
| [[Days]] | a |
The number of days in the duration. |
The abstract operation AdjustDateDurationRecord takes arguments dateDuration (a
The abstract operation CreateDateDurationRecord takes arguments years (an
The abstract operation DateDurationDays takes arguments dateDuration (a
The abstract operation DateDurationSign takes argument dateDuration (a
The abstract operation ZeroDateDuration takes no arguments and returns a
The definitions in this section correspond with equations and operations in
A given time t belongs to day number
Number of days in year are given by:
The day number of the first day of year y is given by:
The time of the start of a year is:
The following function returns 1 for a time within leap year otherwise it returns 0:
The month number for a time t is given by:
where
A month value of 0 specifies January; 1 specifies February; 2 specifies March; 3 specifies April; 4 specifies May; 5 specifies June; 6 specifies July; 7 specifies August; 8 specifies September; 9 specifies October; 10 specifies November; and 11 specifies December. Note that
The date number for a time t is given by:
The weekday for a particular time t is defined as:
A weekday value of 0 specifies Sunday; 1 specifies Monday; 2 specifies Tuesday; 3 specifies Wednesday; 4 specifies Thursday; 5 specifies Friday; and 6 specifies Saturday. Note that
The abstract operation CheckISODaysRange takes argument isoDate (an
The abstract operation EpochDaysToEpochMs takes arguments day (an
The abstract operation ISODateToEpochDays takes arguments year (an
An instant in time to nanosecond precision, or epoch nanoseconds value, as stored in the [[EpochNanoseconds]] internal slot of
The exact moment of midnight at the beginning of 1 January 1970 UTC is represented by the value 0. The maximum value is
The abstract operation AddEpochNanoseconds takes arguments epochNanoseconds (an
The abstract operation CompareEpochNanoseconds takes arguments epochNanosecondsOne (an
The abstract operation DifferenceEpochNanoseconds takes arguments ns1 (an
The abstract operation IsValidEpochNanoseconds takes argument epochNanoseconds (an
The abstract operation RoundEpochNanoseconds takes arguments epochNanoseconds (an
A Internal Duration Record is a
Internal Duration Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Date]] | a |
The date portion of the duration. |
| [[Time]] | a |
The time portion of the duration. |
The abstract operation CombineDateAndTimeDuration takes arguments dateDuration (a
The abstract operation InternalDurationSign takes argument internalDuration (an
The abstract operation ToInternalDurationRecord takes argument duration (a
The abstract operation ToInternalDurationRecordWith24HourDays takes argument duration (a
The only
The abstract operation CompareSurpasses takes arguments sign (either -1 or 1), year (an
The abstract operation ISODateSurpasses takes arguments sign (either -1 or 1), baseDate (an
This operation intentionally uses overflow .since or .until to baseDate may cause a
The abstract operation ISODaysInMonth takes arguments year (an
The Year-Week Record specification type is returned by the week number calculation in
Year-Week Records have the fields listed in table
| Field Name | Value | Meaning |
|---|---|---|
| [[Week]] | a positive |
The calendar week of year. |
| [[Year]] | an |
The week calendar year. |
The abstract operation ISOWeekOfYear takes argument isoDate (an
The abstract operation ISODayOfYear takes argument isoDate (an
The abstract operation ISODayOfWeek takes argument isoDate (an
An ISO Date Record is a
ISO Date Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Year]] | an |
The year in the ISO 8601 calendar. |
| [[Month]] | an |
The number of the month in the ISO 8601 calendar. |
| [[Day]] | an |
The number of the day of the month in the ISO 8601 calendar. |
The abstract operation AddDaysToISODate takes arguments isoDate (an
The abstract operation CompareISODate takes arguments isoDate1 (an
The abstract operation CreateISODateRecord takes arguments year (an
The abstract operation ISODateToFields takes arguments calendar (a
The abstract operation ISODateWithinLimits takes argument isoDate (an Temporal.PlainDate, and
Deferring to
It performs the following steps when called:
The abstract operation IsValidISODate takes arguments year (an
The abstract operation RegulateISODate takes arguments year (an
An ISO Date-Time Record is a
ISO Date-Time Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[ISODate]] | an |
The date in the ISO 8601 calendar. |
| [[Time]] | a |
The time. The [[Days]] field is ignored. |
The abstract operation BalanceISODateTime takes arguments year (an
The abstract operation CombineISODateAndTimeRecord takes arguments isoDate (an
The abstract operation CompareISODateTime takes arguments isoDateTime1 (an
The abstract operation DifferenceISODateTime takes arguments isoDateTime1 (an
The abstract operation ISODateTimeWithinLimits takes argument isoDateTime (an Temporal.PlainDateTime, and
It performs the following steps when called:
The abstract operation RoundISODateTime takes arguments isoDateTime (an
The abstract operation TimeValueToISODateTimeRecord takes argument t (a
Lunisolar calendars may insert leap months into certain years, in order to reconcile the discrepancy between lunar cycles and the solar year. For this reason, a particular month may not have the same ordinal number every year if a leap month is inserted before it.
A month code
The month code for a month that is not a leap month and whose 1-based ordinal position in a common year of the calendar (i.e., a year that is not a leap year) is n is the
The month codes in the ISO 8601 calendar, which does not have leap months, are
The abstract operation CreateMonthCode takes arguments monthNumber (an
It performs the following steps when called:
The abstract operation ParseMonthCode takes argument argument (an
It performs the following steps when called:
This section defines
The abstract operation GetDifferenceSettings takes arguments operation (either
The abstract operation GetDirectionOption takes argument options (an Object) and returns either a
The abstract operation GetRoundingIncrementOption takes argument options (an Object) and returns either a
The abstract operation GetRoundingModeOption takes arguments options (an Object) and fallback (a
The abstract operation GetTemporalDisambiguationOption takes argument options (an Object) and returns either a
The abstract operation GetTemporalFractionalSecondDigitsOption takes argument options (an Object) and returns either a
The abstract operation GetTemporalOffsetOption takes arguments options (an Object) and fallback (one of
The abstract operation GetTemporalOverflowOption takes argument options (an Object) and returns either a
The abstract operation GetTemporalRelativeToOption takes argument options (an Object) and returns either a relativeTo property of its options argument.
If the value is
The abstract operation GetTemporalShowCalendarNameOption takes argument options (an Object) and returns either a
toString methods in Temporal to control whether a calendar annotation should be output.
It performs the following steps when called:
The abstract operation GetTemporalShowOffsetOption takes argument options (an Object) and returns either a
Temporal.ZonedDateTime.prototype.toString().
It is different from the offset property passed to Temporal.ZonedDateTime.from().
It performs the following steps when called:
The abstract operation GetTemporalShowTimeZoneNameOption takes argument options (an Object) and returns either a
Temporal.ZonedDateTime.prototype.toString().
It is different from the timeZone property passed to Temporal.ZonedDateTime.from() and from the timeZone property in the options passed to Temporal.Instant.prototype.toString().
It performs the following steps when called:
The abstract operation GetTemporalUnitValuedOption takes arguments options (an Object), key (a
Both singular and plural unit names are accepted, but only the singular form is used internally.
This section contains definitions pertaining to rounding increments and rounding modes. Several Temporal Objects provide the capability of rounding a quantity to a given increment, following different rounding rules.
A rounding mode is one of the values in the "Rounding Mode" column of
| Rounding Mode | String Identifier | Description | Examples: Round to 0 fraction digits | ||||
|---|---|---|---|---|---|---|---|
| -1.5 | 0.4 | 0.5 | 0.6 | 1.5 | |||
| Toward positive infinity | ⬆️ [-1] | ⬆️ [1] | ⬆️ [1] | ⬆️ [1] | ⬆️ [2] | ||
| Toward negative infinity | ⬇️ [-2] | ⬇️ [0] | ⬇️ [0] | ⬇️ [0] | ⬇️ [1] | ||
| Away from zero | ⬇️ [-2] | ⬆️ [1] | ⬆️ [1] | ⬆️ [1] | ⬆️ [2] | ||
| Toward zero | ⬆️ [-1] | ⬇️ [0] | ⬇️ [0] | ⬇️ [0] | ⬇️ [1] | ||
| Ties toward positive infinity | ⬆️ [-1] | ⬇️ [0] | ⬆️ [1] | ⬆️ [1] | ⬆️ [2] | ||
| Ties toward negative infinity | ⬇️ [-2] | ⬇️ [0] | ⬇️ [0] | ⬆️ [1] | ⬇️ [1] | ||
| Ties away from zero | ⬇️ [-2] | ⬇️ [0] | ⬆️ [1] | ⬆️ [1] | ⬆️ [2] | ||
| Ties toward zero | ⬆️ [-1] | ⬇️ [0] | ⬇️ [0] | ⬆️ [1] | ⬇️ [1] | ||
| Ties toward an even rounding increment multiple | ⬇️ [-2] | ⬇️ [0] | ⬇️ [0] | ⬆️ [1] | ⬆️ [2] | ||
| Rounding Mode | Sign | Unsigned Rounding Mode |
|---|---|---|
The abstract operation ApplyUnsignedRoundingMode takes arguments x (a
The abstract operation GetUnsignedRoundingMode takes arguments roundingMode (a
The abstract operation MaximumTemporalDurationRoundingIncrement takes argument unit (a
The abstract operation NegateRoundingMode takes argument roundingMode (a
The abstract operation RoundNumberToIncrement takes arguments x (a
The abstract operation RoundNumberToIncrementAsIfPositive takes arguments x (a
The abstract operation ValidateTemporalRoundingIncrement takes arguments increment (a positive
A time duration is an
The abstract operation Add24HourDaysToTimeDuration takes arguments d (a
The abstract operation AddTimeDuration takes arguments one (a
The abstract operation AddTimeDurationToEpochNanoseconds takes arguments d (a
The abstract operation RoundTimeDuration takes arguments timeDuration (a
The abstract operation RoundTimeDurationToIncrement takes arguments d (a
The abstract operation TimeDurationFromComponents takes arguments hours (an
The abstract operation TimeDurationFromEpochNanosecondsDifference takes arguments one (an
The abstract operation TimeDurationSign takes argument d (a
The abstract operation TotalTimeDuration takes arguments timeDuration (a
__float128 type if the compiler supports it, or with software emulation such as in the SoftFP library.
A Time Record is a
Time Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Days]] | an |
A number of overflow days. |
| [[Hour]] | an |
The number of the hour. |
| [[Minute]] | an |
The number of the minute. |
| [[Second]] | an |
The number of the second. |
| [[Millisecond]] | an |
The number of the millisecond. |
| [[Microsecond]] | an |
The number of the microsecond. |
| [[Nanosecond]] | an |
The number of the nanosecond. |
The abstract operation AddTime takes arguments time (a
The abstract operation BalanceTime takes arguments hour (an
The abstract operation CompareTimeRecord takes arguments time1 (a
The abstract operation CreateTimeRecord takes arguments hour (an
The abstract operation DifferenceTime takes arguments time1 (a
The abstract operation IsValidTime takes arguments hour (an
The abstract operation MidnightTimeRecord takes no arguments and returns a
The abstract operation NoonTimeRecord takes no arguments and returns a
The abstract operation RegulateTime takes arguments hour (an
The abstract operation RoundTime takes arguments time (a
The abstract operation TimeRecordToString takes arguments time (a
The abstract operation ToTemporalTimeRecord takes argument temporalTimeLike (an Object) and optional argument completeness (either
| Field Name | Property Name |
|---|---|
| [[Hour]] | |
| [[Minute]] | |
| [[Second]] | |
| [[Millisecond]] | |
| [[Microsecond]] | |
| [[Nanosecond]] |
The abstract operation ToTimeRecordOrMidnight takes argument item (an
Time is reckoned using multiple units.
These units are listed in
A Temporal unit is a value listed in the "Value" column of
| Value | Singular |
Plural |
Category | Length in nanoseconds | Maximum duration rounding increment |
|---|---|---|---|---|---|
| calendar-dependent | |||||
| calendar-dependent | |||||
| calendar-dependent | |||||
| 3.6 × 1012 | 24 | ||||
| 6 × 1010 | 60 | ||||
| 109 | 60 | ||||
| 106 | 1000 | ||||
| 103 | 1000 | ||||
| 1 | 1000 |
Temporal.ZonedDateTime.
The abstract operation DefaultTemporalLargestUnit takes argument duration (a Temporal.Duration.prototype.round() method and elsewhere, where the largestUnit option, if not given explicitly, is set to the largest-magnitude non-zero unit. It performs the following steps when called:
The abstract operation IsCalendarUnit takes argument unit (a
The abstract operation LargerOfTwoTemporalUnits takes arguments u1 (a
The abstract operation TemporalUnitCategory takes argument unit (a
The abstract operation ValidateTemporalUnitValue takes arguments value (either a
The abstract operation IsPartialTemporalObject takes argument value (an with() methods: it must be an Object, it must not be an instance of one of the time-related or date-related Temporal types, and it must not have a calendar or timeZone property. It performs the following steps when called:
Several operations in this section are intended to parse strings representing a date, a time, a duration, or a combined date and time. For the purposes of these operations, a valid ISO 8601 / RFC 9557 string is defined as a string that can be generated by one of the goal elements of the following grammar.
This grammar is adapted from the ABNF grammar of the ISO 8601 date-time format that is given in appendix A of RFC 3339, augmented with the grammar of annotations in section 4.1 of RFC 9557.
RFC 9557 and ISO 8601 are similar, but ISO 8601 defines a number of optional deviations that are allowed "by agreement between the communicating parties". The following is a list of deviations supported by this grammar:
- or : separators), as long as each such part is itself in either basic format or extended format (e.g., -- as in RFC 3339 Appendix A.
In addition to the above deviations, any number of conforming RFC 9557 suffixes in square brackets are allowed.
However, the only recognized suffixes are time zone and BCP 47 calendar.
Others are ignored, unless they are prefixed with !, in which case they are rejected.
Note that the suffix keys, although they look similar, are not the same as keys in RFC 6067.
In particular, keys are lowercase-only.
Note the prohibition on negative zero in
Note the prohibition on invalid combinations of month and day in
Note the prohibition on invalid combinations of month and day in
Note the disambiguation between the second alternative without
Grammar symbols not explicitly defined above (
The
The
A RFC 9557 Time Zone Parse Record is a
RFC 9557 Time Zone Parse Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Z]] | a Boolean |
Whether the string contained the Z UTC designator.
|
| [[OffsetString]] | a String or |
The UTC offset from the string, or |
| [[TimeZoneAnnotation]] | a String or |
The time zone annotation from the string, or |
A Time Zone Identifier Parse Record is a
Time Zone Identifier Parse Records have the fields listed in
The two fields are mutually exclusive. One of them always has the value
| Field Name | Value | Meaning |
|---|---|---|
| [[Name]] | a String or |
The time zone's name (not necessarily an |
| [[OffsetMinutes]] | an |
The time zone's UTC offset expressed as a number of minutes, or |
An ISO Date-Time Parse Record is a
For any ISO Date-Time Parse Record r,
ISO Date-Time Parse Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Year]] | an |
The year in the ISO 8601 calendar, or |
| [[Month]] | an |
The number of the month in the ISO 8601 calendar. |
| [[Day]] | an |
The number of the day of the month in the ISO 8601 calendar. |
| [[Time]] | either a |
The time of day, or |
| [[TimeZone]] | an |
A representation of how the time zone was expressed in the string. |
| [[Calendar]] | a String or |
The |
The abstract operation ParseISODateTime takes arguments isoString (a String) and allowedFormats (a
The abstract operation ParseTemporalCalendarString takes argument string (a String) and returns either a
The abstract operation ParseTemporalDurationString takes argument isoString (a String) and returns either a
It performs the following steps when called:
The abstract operation ParseTemporalTimeZoneString takes argument timeZoneString (a String) and returns either a
The abstract operation ParseTimeZoneIdentifier takes argument identifier (a String) and returns either a
This section contains
The abstract operation FormatCalendarAnnotation takes arguments id (a
The abstract operation FormatDateTimeUTCOffsetRounded takes argument offsetNanoseconds (an
The abstract operation FormatFractionalSeconds takes arguments subSecondNanoseconds (an
The abstract operation FormatISODateTime takes arguments isoDateTime (an
The abstract operation FormatOffsetTimeZoneIdentifier takes argument offsetMinutes (an
The abstract operation FormatTimeString takes arguments hour (an
The abstract operation FormatUTCOffsetNanoseconds takes argument offsetNanoseconds (an
The abstract operation PadISOYear takes argument y (an
The abstract operation ToSecondsStringPrecisionRecord takes arguments smallestUnit (one of
The Temporal object:
new operator.The initial value of the
This property has the attributes { [[Writable]]:
See
See
See
See
See
See
See
See
See
The Temporal.Now object:
new operator.The initial value of the
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
The abstract operation SystemDateTime takes argument temporalTimeZoneLike (an
The abstract operation SystemUTCEpochNanoseconds takes no arguments and returns an
A Temporal.Instant object
The
extends clause of a class definition.
Subclass This function performs the following steps when called:
The value of the [[Prototype]] internal slot of the
The
The initial value of Temporal.Instant.prototype is %Temporal.Instant.prototype%.
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
The
The initial value of Temporal.Instant.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.Instant.prototype.epochMilliseconds is an
Temporal.Instant.prototype.epochNanoseconds is an
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as instant1 > instant2 would fall back to being equivalent to instant1.toString() > instant2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.Instant.compare(), Temporal.Instant.prototype.equals(), and/or Temporal.Instant.prototype.toString().
This method performs the following steps when called:
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalInstant]] |
The only specified use of this slot is for distinguishing |
| [[EpochNanoseconds]] |
A BigInt representing the number of nanoseconds since the |
The abstract operation CreateTemporalInstant takes argument epochNanoseconds (an
The abstract operation ToTemporalInstant takes argument item (an
The abstract operation TemporalInstantToString takes arguments instant (a Z if timeZone is
The abstract operation AddDurationToInstant takes arguments operation (either
The abstract operation DifferenceTemporalInstant takes arguments operation (either
A Temporal.ZonedDateTime object
The
extends clause of a class definition.
Subclass This function performs the following steps when called:
The value of the [[Prototype]] internal slot of the
The
The initial value of Temporal.ZonedDateTime.prototype is %Temporal.ZonedDateTime.prototype%.
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
This function performs the following steps when called:
The
The initial value of Temporal.ZonedDateTime.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.ZonedDateTime.prototype.calendarId is an
Temporal.ZonedDateTime.prototype.timeZoneId is an
Temporal.ZonedDateTime.prototype.era is an
Temporal.ZonedDateTime.prototype.eraYear is an
Temporal.ZonedDateTime.prototype.year is an
Temporal.ZonedDateTime.prototype.month is an
Temporal.ZonedDateTime.prototype.monthCode is an
Temporal.ZonedDateTime.prototype.day is an
Temporal.ZonedDateTime.prototype.hour is an
Temporal.ZonedDateTime.prototype.minute is an
Temporal.ZonedDateTime.prototype.second is an
Temporal.ZonedDateTime.prototype.millisecond is an
Temporal.ZonedDateTime.prototype.microsecond is an
Temporal.ZonedDateTime.prototype.nanosecond is an
Temporal.ZonedDateTime.prototype.epochMilliseconds is an
Temporal.ZonedDateTime.prototype.epochNanoseconds is an
Temporal.ZonedDateTime.prototype.dayOfWeek is an
Temporal.ZonedDateTime.prototype.dayOfYear is an
Temporal.ZonedDateTime.prototype.weekOfYear is an
Temporal.ZonedDateTime.prototype.yearOfWeek is an
Temporal.ZonedDateTime.prototype.hoursInDay is an
Temporal.ZonedDateTime.prototype.daysInWeek is an
Temporal.ZonedDateTime.prototype.daysInMonth is an
Temporal.ZonedDateTime.prototype.daysInYear is an
Temporal.ZonedDateTime.prototype.monthsInYear is an
Temporal.ZonedDateTime.prototype.inLeapYear is an
Temporal.ZonedDateTime.prototype.offsetNanoseconds is an
Temporal.ZonedDateTime.prototype.offset is an
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as zonedDateTime1 > zonedDateTime2 would fall back to being equivalent to zonedDateTime1.toString() > zonedDateTime2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.ZonedDateTime.compare(), Temporal.ZonedDateTime.prototype.equals(), and/or Temporal.ZonedDateTime.prototype.toString().
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalZonedDateTime]] |
The only specified use of this slot is for distinguishing |
| [[EpochNanoseconds]] |
A BigInt representing the number of nanoseconds since the |
| [[TimeZone]] |
An |
| [[Calendar]] |
A |
The abstract operation CreateTemporalZonedDateTime takes arguments epochNanoseconds (an
The abstract operation ToTemporalZonedDateTime takes argument item (an
The abstract operation TemporalZonedDateTimeToString takes arguments zonedDateTime (a
The abstract operation AddZonedDateTime takes arguments epochNanoseconds (an
The abstract operation AddDurationToZonedDateTime takes arguments operation (either
The abstract operation DifferenceZonedDateTime takes arguments ns1 (an
The abstract operation DifferenceZonedDateTimeWithRounding takes arguments ns1 (an
The abstract operation DifferenceZonedDateTimeWithTotal takes arguments ns1 (an
The abstract operation DifferenceTemporalZonedDateTime takes arguments operation (either
The abstract operation InterpretISODateTimeOffset takes arguments isoDate (an
It determines the exact time in timeZone corresponding to the given calendar date and time, and the given UTC offset in nanoseconds. In the case of more than one possible exact time, or no possible exact time, an answer is determined using offsetBehaviour, disambiguation and offsetOption.
As a special case when parsing
It performs the following steps when called:
A Temporal.PlainDateTime object
The
extends clause of a class definition.
Subclass This function performs the following steps when called:
The value of the [[Prototype]] internal slot of the
The
The initial value of Temporal.PlainDateTime.prototype is
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
This function performs the following steps when called:
The
The initial value of Temporal.PlainDateTime.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.PlainDateTime.prototype.calendarId is an
Temporal.PlainDate.prototype.era is an
Temporal.PlainDateTime.prototype.eraYear is an
Temporal.PlainDateTime.prototype.year is an
Temporal.PlainDateTime.prototype.month is an
Temporal.PlainDateTime.prototype.monthCode is an
Temporal.PlainDateTime.prototype.day is an
Temporal.PlainDateTime.prototype.hour is an
Temporal.PlainDateTime.prototype.minute is an
Temporal.PlainDateTime.prototype.second is an
Temporal.PlainDateTime.prototype.millisecond is an
Temporal.PlainDateTime.prototype.microsecond is an
Temporal.PlainDateTime.prototype.nanosecond is an
Temporal.PlainDateTime.prototype.dayOfWeek is an
Temporal.PlainDateTime.prototype.dayOfYear is an
Temporal.PlainDateTime.prototype.weekOfYear is an
Temporal.PlainDateTime.prototype.yearOfWeek is an
Temporal.PlainDateTime.prototype.daysInWeek is an
Temporal.PlainDateTime.prototype.daysInMonth is an
Temporal.PlainDateTime.prototype.daysInYear is an
Temporal.PlainDateTime.prototype.monthsInYear is an
Temporal.PlainDateTime.prototype.inLeapYear is an
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as plainDateTime1 > plainDateTime2 would fall back to being equivalent to plainDateTime1.toString() > plainDateTime2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.PlainDateTime.compare(), Temporal.PlainDateTime.prototype.equals(), and/or Temporal.PlainDateTime.prototype.toString().
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalDateTime]] |
The only specified use of this slot is for distinguishing |
| [[ISODateTime]] |
An |
| [[Calendar]] |
A |
The abstract operation CreateTemporalDateTime takes arguments isoDateTime (an
The abstract operation ToTemporalDateTime takes argument item (an
The abstract operation AddDurationToDateTime takes arguments operation (either
The abstract operation DifferenceTemporalPlainDateTime takes arguments operation (either
The abstract operation DifferencePlainDateTimeWithRounding takes arguments isoDateTime1 (an
The abstract operation DifferencePlainDateTimeWithTotal takes arguments isoDateTime1 (an
The abstract operation InterpretTemporalDateTimeFields takes arguments calendar (a
A Temporal.PlainDate object
The
extends clause of a class definition.
Subclass This function performs the following steps when called:
The
The initial value of Temporal.PlainDate.prototype is %Temporal.PlainDate.prototype%.
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
This function performs the following steps when called:
The
The initial value of Temporal.PlainDate.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.PlainDate.prototype.calendarId is an
Temporal.PlainDate.prototype.era is an
Temporal.PlainDate.prototype.eraYear is an
Temporal.PlainDate.prototype.year is an
Temporal.PlainDate.prototype.month is an
Temporal.PlainDate.prototype.monthCode is an
Temporal.PlainDate.prototype.day is an
Temporal.PlainDate.prototype.dayOfWeek is an
Temporal.PlainDate.prototype.dayOfYear is an
Temporal.PlainDate.prototype.weekOfYear is an
Temporal.PlainDate.prototype.yearOfWeek is an
Temporal.PlainDate.prototype.daysInWeek is an
Temporal.PlainDate.prototype.daysInMonth is an
Temporal.PlainDate.prototype.daysInYear is an
Temporal.PlainDate.prototype.monthsInYear is an
Temporal.PlainDate.prototype.inLeapYear is an
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as plainDate1 > plainDate2 would fall back to being equivalent to plainDate1.toString() > plainDate2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.PlainDate.compare(), Temporal.PlainDate.prototype.equals(), and/or Temporal.PlainDate.prototype.toString().
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalDate]] |
The only specified use of this slot is for distinguishing |
| [[ISODate]] |
An |
| [[Calendar]] |
A |
The abstract operation CreateTemporalDate takes arguments isoDate (an
The abstract operation ToTemporalDate takes argument item (an
The abstract operation TemporalDateToString takes arguments temporalDate (a
The abstract operation AddDurationToDate takes arguments operation (either
The abstract operation DifferenceTemporalPlainDate takes arguments operation (either
A Temporal.PlainTime object
The
extends clause of a class definition.
Subclass This function performs the following steps when called:
The value of the [[Prototype]] internal slot of the
The
The initial value of Temporal.PlainTime.prototype is %Temporal.PlainTime.prototype%.
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
This function performs the following steps when called:
The
The initial value of Temporal.PlainTime.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.PlainTime.prototype.hour is an
Temporal.PlainTime.prototype.minute is an
Temporal.PlainTime.prototype.second is an
Temporal.PlainTime.prototype.millisecond is an
Temporal.PlainTime.prototype.microsecond is an
Temporal.PlainTime.prototype.nanosecond is an
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as plainTime1 > plainTime2 would fall back to being equivalent to plainTime1.toString() > plainTime2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.PlainTime.compare(), Temporal.PlainTime.prototype.equals(), and/or Temporal.PlainTime.prototype.toString().
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalTime]] |
The only specified use of this slot is for distinguishing |
| [[Time]] |
A |
The abstract operation CreateTemporalTime takes argument time (a
The abstract operation ToTemporalTime takes argument item (an
The abstract operation AddDurationToTime takes arguments operation (either
The abstract operation DifferenceTemporalPlainTime takes arguments operation (either
A Temporal.PlainYearMonth object
The
extends clause of a class definition.
Subclass This function performs the following steps when called:
The value of the [[Prototype]] internal slot of the
The
The initial value of Temporal.PlainYearMonth.prototype is %Temporal.PlainYearMonth.prototype%.
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
This function performs the following steps when called:
The
The initial value of Temporal.PlainYearMonth.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.PlainYearMonth.prototype.calendarId is an
Temporal.PlainYearMonth.prototype.era is an
Temporal.PlainYearMonth.prototype.eraYear is an
Temporal.PlainYearMonth.prototype.year is an
Temporal.PlainYearMonth.prototype.month is an
Temporal.PlainYearMonth.prototype.monthCode is an
Temporal.PlainYearMonth.prototype.daysInYear is an
Temporal.PlainYearMonth.prototype.daysInMonth is an
Temporal.PlainYearMonth.prototype.monthsInYear is an
Temporal.PlainYearMonth.prototype.inLeapYear is an
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as plainYearMonth1 > plainYearMonth2 would fall back to being equivalent to plainYearMonth1.toString() > plainYearMonth2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.PlainYearMonth.compare(), Temporal.PlainYearMonth.prototype.equals(), and/or Temporal.PlainYearMonth.prototype.toString().
This method performs the following steps when called:
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalYearMonth]] |
The only specified use of this slot is for distinguishing |
| [[ISODate]] |
An |
| [[Calendar]] |
A |
The abstract operation CreateTemporalYearMonth takes arguments isoDate (an
The abstract operation ToTemporalYearMonth takes argument item (an
The abstract operation TemporalYearMonthToString takes arguments yearMonth (a
The abstract operation AddDurationToYearMonth takes arguments operation (either
The abstract operation DifferenceTemporalPlainYearMonth takes arguments operation (either
An ISO Year-Month Record is a
ISO Year-Month Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Year]] | an |
The year in the ISO 8601 calendar. |
| [[Month]] | an |
The number of the month in the ISO 8601 calendar. |
The abstract operation BalanceISOYearMonth takes arguments year (an
The abstract operation ISOYearMonthWithinLimits takes argument isoDate (an
A Temporal.PlainMonthDay object
The
extends clause of a class definition.
Subclass This function performs the following steps when called:
The value of the [[Prototype]] internal slot of the
The
The initial value of Temporal.PlainMonthDay.prototype is %Temporal.PlainMonthDay.prototype%.
This property has the attributes { [[Writable]]:
This function performs the following steps when called:
The
The initial value of Temporal.PlainMonthDay.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.PlainMonthDay.prototype.calendarId is an
Temporal.PlainMonthDay.prototype.monthCode is an
Temporal.PlainMonthDay.prototype.day is an
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as plainMonthDay1 > plainMonthDay2 would fall back to being equivalent to plainMonthDay1.toString() > plainMonthDay2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.PlainDate.compare() on the corresponding PlainDate objects, Temporal.PlainMonthDay.prototype.equals(), and/or Temporal.PlainMonthDay.prototype.toString().
This method performs the following steps when called:
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalMonthDay]] |
The only specified use of this slot is for distinguishing |
| [[ISODate]] |
An |
| [[Calendar]] |
A |
The abstract operation CreateTemporalMonthDay takes arguments isoDate (an
The abstract operation ToTemporalMonthDay takes argument item (an
The abstract operation TemporalMonthDayToString takes arguments monthDay (a
A Temporal.Duration object describes the difference in elapsed time between
two other Temporal objects of the same type:
The
extends clause of a class definition.
Subclass The Temporal.Duration function performs the following steps when called:
The value of the [[Prototype]] internal slot of the
The
The initial value of Temporal.Duration.prototype is
%Temporal.Duration.prototype%.
This property has the attributes { [[Writable]]:
The Temporal.Duration.from function performs the following steps when called:
The Temporal.Duration.compare function performs the following steps when called:
The
The initial value of Temporal.Duration.prototype.constructor is
The initial value of the
This property has the attributes { [[Writable]]:
Temporal.Duration.prototype.years is an
Temporal.Duration.prototype.months is an
Temporal.Duration.prototype.weeks is an
Temporal.Duration.prototype.days is an
Temporal.Duration.prototype.hours is an
Temporal.Duration.prototype.minutes is an
Temporal.Duration.prototype.seconds is an
Temporal.Duration.prototype.milliseconds is an
Temporal.Duration.prototype.microseconds is an
Temporal.Duration.prototype.nanoseconds is an
Temporal.Duration.prototype.sign is an
Temporal.Duration.prototype.blank is an
The Temporal.Duration.prototype.with method performs the following steps when called:
The Temporal.Duration.prototype.negated method performs the following steps when called:
The Temporal.Duration.prototype.abs method performs the following steps when called:
The Temporal.Duration.prototype.add method performs the following steps when called:
The Temporal.Duration.prototype.subtract method performs the following steps when called:
The Temporal.Duration.prototype.round method performs the following steps when called:
The Temporal.Duration.prototype.total method performs the following steps when called:
The Temporal.Duration.prototype.toString method performs the following steps when called:
The Temporal.Duration.prototype.toJSON method performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the Temporal.Duration.prototype.toLocaleString method as specified in the ECMA-402 specification.
If an ECMAScript implementation does not include the ECMA-402 API the following specification of the Temporal.Duration.prototype.toLocaleString method is used.
The Temporal.Duration.prototype.toLocaleString method performs the following steps when called:
The Temporal.Duration.prototype.valueOf method performs the following steps when called:
This method always throws, because in the absence of valueOf(), expressions with arithmetic operators such as duration1 > duration2 would fall back to being equivalent to duration1.toString() > duration2.toString().
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to Temporal.Duration.compare() and/or Temporal.Duration.prototype.toString().
A float64-representable integer is an
| Internal Slot | Description |
|---|---|
| [[InitializedTemporalDuration]] |
The only specified use of this slot is for distinguishing |
| [[Years]] |
A |
| [[Months]] |
A |
| [[Weeks]] |
A |
| [[Days]] |
A |
| [[Hours]] |
A |
| [[Minutes]] |
A |
| [[Seconds]] |
A |
| [[Milliseconds]] |
A |
| [[Microseconds]] |
A |
| [[Nanoseconds]] |
A |
The abstract operation CreateTemporalDuration takes arguments years (an
The abstract operation CreateNegatedTemporalDuration takes argument duration (a
The abstract operation TemporalDurationFromInternal takes arguments internalDuration (an Temporal.Duration object, with each component stored separately.
The time units are balanced up to largestUnit.
The conversion may be lossy if largestUnit is
std::fma(). String manipulation will also give an exact result, since the multiplication is by a power of 10.The abstract operation ToTemporalDuration takes argument item (an
The abstract operation TemporalDurationToString takes arguments duration (a
The abstract operation AddDurations takes arguments operation (either
The abstract operation DurationSign takes argument duration (a
The abstract operation IsValidDuration takes arguments years (an
std::remquo() with sufficient bits in the quotient. String manipulation will also give an exact result, since the multiplication is by a power of 10.A partial Duration Record is a
Partial Duration Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Years]] | a |
The number of years in the duration. |
| [[Months]] | a |
The number of months in the duration. |
| [[Weeks]] | a |
The number of weeks in the duration. |
| [[Days]] | a |
The number of days in the duration. |
| [[Hours]] | a |
The number of hours in the duration. |
| [[Minutes]] | a |
The number of minutes in the duration. |
| [[Seconds]] | a |
The number of seconds in the duration. |
| [[Milliseconds]] | a |
The number of milliseconds in the duration. |
| [[Microseconds]] | a |
The number of microseconds in the duration. |
| [[Nanoseconds]] | a |
The number of nanoseconds in the duration. |
The abstract operation ToPartialDurationRecord takes argument temporalDurationLike (an
A Duration Nudge Result Record is a
Duration Nudge Result Records have the fields listed in
| Field Name | Value | Meaning |
|---|---|---|
| [[Duration]] | an |
The resulting duration. |
| [[NudgedEpochNs]] | an |
The |
| [[DidExpandCalendarUnit]] | a Boolean | Whether the rounding operation caused the duration to expand to the next day or larger unit. |
The abstract operation ComputeNudgeWindow takes arguments sign (either -1 or 1), duration (an
The abstract operation NudgeToCalendarUnit takes arguments sign (either -1 or 1), duration (an
__float128 type if the compiler supports it, or with software emulation such as in the SoftFP library.The abstract operation NudgeToZonedTime takes arguments sign (either -1 or 1), duration (an Temporal.ZonedDateTime starting point, accounting for the case where the rounding causes the time to exceed the total time within a day, which may be influenced by UTC offset changes in the time zone.
It performs the following steps when called:
The abstract operation NudgeToDayOrTime takes arguments duration (an
The abstract operation BubbleRelativeDuration takes arguments sign (either -1 or 1), duration (an
The abstract operation RoundRelativeDuration takes arguments duration (an
The abstract operation TotalRelativeDuration takes arguments duration (an