diff --git a/spec/intl.html b/spec/intl.html index d0c64cd88..507278588 100644 --- a/spec/intl.html +++ b/spec/intl.html @@ -31,174 +31,6 @@

Cas - - - -

Use of the IANA Time Zone Database

- - This section replaces the
Time Zone Names section in ECMA-402. -

- Implementations that adopt this specification are time zone aware: they use the IANA Time Zone Database https://www.iana.org/time-zones/ to supply available time zone identifiers and data used in ECMAScript calculations and formatting. - This section defines how the IANA Time Zone Database should be used by time zone aware implementations. -

-

- Except as overridden by AvailableNamedTimeZoneIdentifiers, each Zone in the IANA Time Zone Database must be a primary time zone identifier and each Link name in the IANA Time Zone Database must be a non-primary time zone identifier. - No String may be an available named time zone identifier unless it is a Zone name or a Link name in the IANA Time Zone Database. - Available named time zone identifiers returned by ECMAScript built-in objects must use the casing found in the IANA Time Zone Database. -

-

- In the IANA Time Zone Database, the UTC time zone is represented by the Zone *"Etc/UTC"* which is distinct from the Zone *"Etc/GMT"*. - For historical reasons, ECMAScript uses *"UTC"* as the primary identifier for the former Zone and does not recognize the latter Zone as distinct, instead requiring *"Etc/UTC"*, *"Etc/GMT"*, and *"GMT"* (if available) to be non-primary identifiers that resolve to *"UTC"*. - This is the only deviation from the IANA Time Zone Database that is required of a time zone aware ECMAScript implementation. -

-

- The IANA Time Zone Database is typically updated between five and ten times per year. - These updates may add new Zone or Link names, may change Zones to Links, and may change the UTC offsets and transitions associated with any Zone. - ECMAScript implementations are recommended to include updates to the IANA Time Zone Database as soon as possible. - Such prompt action ensures that ECMAScript programs can accurately perform time-zone-sensitive calculations and can use newly-added available named time zone identifiers supplied by external input or the host environment. -

- - -

- Although the IANA Time Zone Database maintainers strive for stability, in rare cases (averaging less than once per year) a Zone may be replaced by a new Zone. - For example, in 2022 "*Europe/Kiev*" was deprecated to a Link resolving to a new "*Europe/Kyiv*" Zone. -

-

- To reduce disruption from renaming changes, ECMAScript implementations are encouraged to initially add the new Zone as a non-primary time zone identifier that resolves to the current primary identifier. - Then, after a waiting period, implementations are recommended to promote the new Zone to a primary time zone identifier while simultaneously demoting the deprecated name to non-primary. - The recommended waiting period is two years after the IANA Time Zone Database release containing the changes. - This delay allows other systems, that ECMAScript programs may interact with, to be updated to recognize the new Zone. -

-

- A waiting period should only apply when a new Zone is added to replace an existing Zone. - If an existing Zone and Link are swapped, then no waiting period is necessary. -

-
- -

- If implementations revise time zone information during the lifetime of an agent, then which identifiers are supported, the primary time zone identifier associated with any identifier, and the UTC offsets and transitions associated with any Zone, must be consistent with results previously observed by that agent. - Due to the complexity of supporting this requirement, it is recommended that implementations maintain a fully consistent copy of the IANA Time Zone Database for the lifetime of each agent. -

- -

This section complements but does not supersede .

- - -

- The IANA Time Zone Database offers build options that affect which available time zone identifiers are primary. - The default build options merge different countries' time zones, for example *"Atlantic/Reykjavik"* being a Link to the Zone *"Africa/Abidjan"*. - Geographically and politically distinct locations are likely to introduce divergent time zone rules in a future version of the IANA Time Zone Database. - Therefore, it is recommended that ECMAScript implementations instead use build options such as PACKRATDATA=backzone PACKRATLIST=zone.tab or a similar alternative that ensures at least one primary identifier for each ISO 3166-1 Alpha-2 country code. -

-
- - -

AvailableNamedTimeZoneIdentifiers ( ): a List of Time Zone Identifier Records

-
-
description
-
- Its result describes all available named time zone identifiers in this implementation, as well as the primary time zone identifier corresponding to each available named time zone identifier. - The List is ordered according to the [[Identifier]] field of each Time Zone Identifier Record. -
-
redefinition
-
true
-
-

This definition supersedes the definition provided in .

- - 1. Let _identifiers_ be a List containing the String value of each Zone or Link name in the IANA Time Zone Database, sorted according to lexicographic code unit order. - 1. Assert: No element of _identifiers_ is an ASCII-case-insensitive match for any other element. - 1. Assert: Every element of _identifiers_ identifies a Zone or Link name in the IANA Time Zone Database. - 1. Let _result_ be a new empty List. - 1. For each element _identifier_ of _identifiers_, do - 1. Let _primary_ be _identifier_. - 1. If _identifier_ is a non-primary time zone identifier and _identifier_ is not *"UTC"*, then - 1. Set _primary_ to the name of the primary time zone identifier that _identifier_ resolves to, according to the rules for resolving Link names in the IANA Time Zone Database. - 1. NOTE: An implementation may need to resolve _identifier_ iteratively to obtain the primary time zone identifier. - 1. If _primary_ is one of *"Etc/UTC"*, *"Etc/GMT"*, or *"GMT"*, set _primary_ to *"UTC"*. - 1. Let _record_ be the Time Zone Identifier Record { [[Identifier]]: _identifier_, [[PrimaryIdentifier]]: _primary_ }. - 1. Append _record_ to _result_. - 1. Assert: _result_ contains a Time Zone Identifier Record _r_ such that _r_.[[Identifier]] is *"UTC"* and _r_.[[PrimaryIdentifier]] is *"UTC"*. - 1. Return _result_. - - - - Time zone identifiers in the IANA Time Zone Database can change over time. - At a minimum, implementations must limit changes to the result of AvailableNamedTimeZoneIdentifiers to the changes allowed by GetAvailableNamedTimeZoneIdentifier, for the lifetime of the surrounding agent. - That is, implementations must not remove support for or change the primary vs. non-primary status of an identifier that was already reported as available, and they must not add support for an identifier that was already reported as not available. - Due to the complexity of supporting these recommendations, it is recommended that the result of AvailableNamedTimeZoneIdentifiers remains the same for the lifetime of the surrounding agent. - -
- - - - - - -

Time Zone Names

- -

This specification identifies time zones using the Zone and Link names of the IANA Time Zone Database. Their canonical form is the corresponding Zone name in the casing used in the IANA Time Zone Database except as specifically overridden by CanonicalizeTimeZoneName.

- -

A conforming implementation must recognize *"UTC"* and all other Zone and Link names (and only such names), and use best available current and historical information about their offsets from UTC and their daylight saving time rules in calculations. However, the set of combinations of time zone name and language tag for which localized time zone names are available is implementation dependent.

- - -

- IsValidTimeZoneName ( - _timeZone_: a String, - ): a Boolean -

-
-
description
-
It verifies that the _timeZone_ argument represents a valid Zone or Link name of the IANA Time Zone Database.
-
- - 1. If one of the Zone or Link names of the IANA Time Zone Database is an ASCII-case-insensitive match for _timeZone_, return *true*. - 1. If _timeZone_ is an ASCII-case-insensitive match for *"UTC"*, return *true*. - 1. Return *false*. - -
- - - Any value returned from SystemTimeZoneIdentifier that is not recognized as valid by IsTimeZoneOffsetString must be recognized as valid by IsValidTimeZoneName. - - - -

- CanonicalizeTimeZoneName ( - _timeZone_: a String value that is a valid time zone name as verified by IsValidTimeZoneName, - ) -

-
-
description
-
It returns the canonical and case-regularized form of _timeZone_.
-
- - 1. Let _ianaTimeZone_ be the String value of the Zone or Link name of the IANA Time Zone Database that is an ASCII-case-insensitive match of _timeZone_. - 1. If _ianaTimeZone_ is a Link name, set _ianaTimeZone_ to the String value of the corresponding Zone name as specified in the file backward of the IANA Time Zone Database. - 1. If _ianaTimeZone_ is *"Etc/UTC"* or *"Etc/GMT"*, or *"GMT"*, return *"UTC"*. - 1. Return _ianaTimeZone_. - -
- - -

AvailableCanonicalTimeZones ( ): a List of Strings

-
-
description
-
The returned List is a sorted List of supported Zone and Link names in the IANA Time Zone Database.
-
- - 1. Let _names_ be a List of all Zone and Link names in the IANA Time Zone Database that are supported by the implementation. - 1. Let _result_ be a new empty List. - 1. For each element _name_ of _names_, do - 1. Assert: IsValidTimeZoneName( _name_ ) is *true*. - 1. Let _canonical_ be CanonicalizeTimeZoneName( _name_ ). - 1. If _result_ does not contain _canonical_, then - 1. Append _canonical_ to _result_. - 1. [declared="comparefn"] Sort _result_ in order as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_. - 1. Return _result_. - -
-
-
- @@ -218,47 +50,6 @@

AvailableCalendars ( ): a List of Strings

- -

The Intl Object

-

[...]

- - -

Function Properties of the Intl Object

-

[...]

- - -

Intl.supportedValuesOf ( _key_ )

- -

When the `supportedValuesOf` method is called with argument _key_ , the following steps are taken:

- - - 1. Let _key_ be ? ToString(_key_). - 1. If _key_ is *"calendar"*, then - 1. Let _list_ be a new empty List. - 1. For each element _identifier_ of AvailableCalendars(), do - 1. Let _canonical_ be CanonicalizeUValue(*"ca"*, _identifier_). - 1. If _identifier_ is _canonical_, then - 1. Append _identifier_ to _list_. - 1. Else if _key_ is *"collation"*, then - 1. Let _list_ be AvailableCanonicalCollations( ). - 1. Else if _key_ is *"currency"*, then - 1. Let _list_ be AvailableCanonicalCurrencies( ). - 1. Else if _key_ is *"numberingSystem"*, then - 1. Let _list_ be AvailableCanonicalNumberingSystems( ). - 1. Else if _key_ is *"timeZone"*, then - 1. Let _list_ be AvailablePrimaryTimeZoneIdentifiers( ). - 1. Let _timeZones_ be AvailableNamedTimeZoneIdentifiers(). - 1. [declared="record"] Let _list_ be a List consisting of every element _record_ of _timeZones_ for which _record_.[[Identifier]] = _record_.[[PrimaryIdentifier]]. - 1. Else if _key_ is *"unit"*, then - 1. Let _list_ be AvailableCanonicalUnits( ). - 1. Else, - 1. Throw a *RangeError* exception. - 1. Return CreateArrayFromList( _list_ ). - -
-
-
-

Abstract Operations

@@ -927,111 +718,6 @@

DateTime Format Functions

The *"length"* property of a DateTime format function is *1*𝔽.

- -

- FormatDateTimePattern ( - _dateTimeFormat_: an Intl.DateTimeFormat, - _format_: a DateTime Format Record or a DateTime Range Pattern Format Record, - _pattern_: a Pattern String, - _x_: a Number, - _epochNanoseconds_: a BigInt, - ): a List of Records with fields [[Type]] (a String) and [[Value]] (a String) -

-
-
description
-
It interprets _x_ as a time value as specified in es2024, , and creates the corresponding parts for the epoch time _epochNanoseconds_ according to _pattern_ and to the effective locale and the formatting options of _dateTimeFormat_ and _format_.
-
- - 1. Let _x_ be TimeClip(_x_). - 1. If _x_ is *NaN*, throw a *RangeError* exception. - 1. Let _locale_ be _dateTimeFormat_.[[Locale]]. - 1. Let _nfOptions_ be OrdinaryObjectCreate(*null*). - 1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"useGrouping"*, *false*). - 1. Let _nf_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nfOptions_ »). - 1. Let _nf2Options_ be OrdinaryObjectCreate(*null*). - 1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"minimumIntegerDigits"*, *2*𝔽). - 1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"useGrouping"*, *false*). - 1. Let _nf2_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf2Options_ »). - 1. If _format_ has a field [[fractionalSecondDigits]], then - 1. Let _fractionalSecondDigits_ be _format_.[[fractionalSecondDigits]]. - 1. Let _nf3Options_ be OrdinaryObjectCreate(*null*). - 1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"minimumIntegerDigits"*, 𝔽(_fractionalSecondDigits_)). - 1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"useGrouping"*, *false*). - 1. Let _nf3_ be ! Construct(%Intl.NumberFormat%, « _locale_, _nf3Options_ »). - 1. Let _tm_ be ToLocalTime(ℤ(ℝ(_x_) × 106)_epochNanoseconds_, _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]). - 1. Let _patternParts_ be PartitionPattern(_pattern_). - 1. Let _result_ be a new empty List. - 1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do - 1. Let _p_ be _patternPart_.[[Type]]. - 1. If _p_ is *"literal"*, then - 1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_. - 1. Else if _p_ is *"fractionalSecondDigits"*, then - 1. Assert: _format_ has a field [[fractionalSecondDigits]]. - 1. Let _v_ be _tm_.[[Millisecond]]. - 1. Set _v_ to floor(_v_ × 10( _fractionalSecondDigits_ - 3 )). - 1. Let _fv_ be FormatNumeric(_nf3_, _v_). - 1. Append the Record { [[Type]]: *"fractionalSecond"*, [[Value]]: _fv_ } to _result_. - 1. Else if _p_ is *"dayPeriod"*, then - 1. Assert: _format_ has a field [[dayPeriod]]. - 1. Let _f_ be _format_.[[dayPeriod]]. - 1. Let _fv_ be a String value representing the day period of _tm_ in the form given by _f_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_. - 1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_. - 1. Else if _p_ is *"timeZoneName"*, then - 1. Assert: _format_ has a field [[timeZoneName]]. - 1. Let _f_ be _format_.[[timeZoneName]]. - 1. Let _v_ be _dateTimeFormat_.[[TimeZone]]. - 1. Let _fv_ be a String value representing _v_ in the form given by _f_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_. The String value may also depend on the value of the [[InDST]] field of _tm_ if _f_ is *"short"*, *"long"*, *"shortOffset"*, or *"longOffset"*. If the implementation does not have such a localized representation of _f_, then use the String value of _v_ itself. - 1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_. - 1. Else if _p_ matches a Property column of the row in , then - 1. Assert: _format_ has a field [[<_p_>]]. - 1. Let _f_ be _format_.[[<_p_>]]. - 1. Let _v_ be the value of _tm_'s field whose name is the Internal Slot column of the matching row. - 1. If _p_ is *"year"* and _v_ ≤ 0, set _v_ to 1 - _v_. - 1. If _p_ is *"month"*, set _v_ to _v_ + 1. - 1. If _p_ is *"hour"* and _dateTimeFormat_.[[HourCycle]] is *"h11"* or *"h12"*, then - 1. Set _v_ to _v_ modulo 12. - 1. If _v_ is 0 and _dateTimeFormat_.[[HourCycle]] is *"h12"*, set _v_ to 12. - 1. If _p_ is *"hour"* and _dateTimeFormat_.[[HourCycle]] is *"h24"*, then - 1. If _v_ is 0, set _v_ to 24. - 1. If _f_ is *"numeric"*, then - 1. Let _fv_ be FormatNumeric(_nf_, _v_). - 1. Else if _f_ is *"2-digit"*, then - 1. Let _fv_ be FormatNumeric(_nf2_, _v_). - 1. Let _codePoints_ be StringToCodePoints(_fv_). - 1. Let _count_ be the number of elements in _codePoints_. - 1. If _count_ > 2, then - 1. Let _tens_ be _codePoints_[_count_ - 2]. - 1. Let _ones_ be _codePoints_[_count_ - 1]. - 1. Set _fv_ to CodePointsToString(« _tens_, _ones_ »). - 1. Else if _f_ is *"narrow"*, *"short"*, or *"long"*, then - 1. Let _fv_ be a String value representing _v_ in the form given by _f_; the String value depends upon the implementation and the effective locale and calendar of _dateTimeFormat_. If _p_ is *"month"*, then the String value may also depend on whether _format_.[[day]] is present. If the implementation does not have a localized representation of _f_, then use the String value of _v_ itself. - 1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_. - 1. Else if _p_ is *"ampm"*, then - 1. Let _v_ be _tm_.[[Hour]]. - 1. If _v_ is greater than 11, then - 1. Let _fv_ be an implementation and locale dependent String value representing *"post meridiem"*. - 1. Else, - 1. Let _fv_ be an implementation and locale dependent String value representing *"ante meridiem"*. - 1. Append the Record { [[Type]]: *"dayPeriod"*, [[Value]]: _fv_ } to _result_. - 1. Else if _p_ is *"relatedYear"*, then - 1. Let _v_ be _tm_.[[RelatedYear]]. - 1. Let _fv_ be FormatNumeric(_nf_, _v_). - 1. Append the Record { [[Type]]: *"relatedYear"*, [[Value]]: _fv_ } to _result_. - 1. Else if _p_ is *"yearName"*, then - 1. Let _v_ be _tm_.[[YearName]]. - 1. Let _fv_ be an implementation and locale dependent String value representing _v_. - 1. Append the Record { [[Type]]: *"yearName"*, [[Value]]: _fv_ } to _result_. - 1. Else, - 1. Let _unknown_ be an implementation-, locale-, and numbering system-dependent String based on _x__epochNanoseconds_ and _p_. - 1. Append the Record { [[Type]]: *"unknown"*, [[Value]]: _unknown_ } to _result_. - 1. Return _result_. - - - - It is recommended that implementations use the locale and calendar dependent strings provided by the Common Locale Data Repository (available at https://cldr.unicode.org/), and use CLDR *"abbreviated"* strings for DateTimeFormat *"short"* strings, and CLDR *"wide"* strings for DateTimeFormat *"long"* strings. - -
-

PartitionDateTimePattern ( @@ -1044,14 +730,18 @@

It interprets _x_ as a time value as specified in es2024, an epoch time, and creates the corresponding parts according to the type of _x_, effective locale, and the formatting options of _dateTimeFormat_.
+ 1. Let _x_ be TimeClip(_x_). + 1. If _x_ is *NaN*, throw a *RangeError* exception. + 1. Let _epochNanoseconds_ be ℤ(ℝ(_x_) × 106). 1. Let _format_ be _dateTimeFormat_.[[DateTimeFormat]]. - 1. Let _xFormatRecord_ be ? HandleDateTimeValue(_dateTimeFormat_, _x_). - 1. Let _format_ be _xFormatRecord_.[[Format]]. + 1. Let _formatRecord_ be ? HandleDateTimeValue(_dateTimeFormat_, _x_). + 1. Let _epochNanoseconds_ be _formatRecord_.[[EpochNanoseconds]]. + 1. Let _format_ be _formatRecord_.[[Format]]. 1. If _format_ has a field [[hour]] and _dateTimeFormat_.[[HourCycle]] is *"h11"* or *"h12"*, then 1. Let _pattern_ be _format_.[[pattern12]]. 1. Else, 1. Let _pattern_ be _format_.[[pattern]]. - 1. Let _result_ be ? FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x__xFormatRecord_.[[EpochNanoseconds]]). + 1. Let _result_ be FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _epochNanoseconds_). 1. Return _result_. @@ -1114,12 +804,16 @@

1. If _x_ is *NaN*, throw a *RangeError* exception. 1. Let _y_ be TimeClip(_y_). 1. If _y_ is *NaN*, throw a *RangeError* exception. + 1. Let _xEpochNanoseconds_ be ℤ(ℝ(_x_) × 106). + 1. Let _yEpochNanoseconds_ be ℤ(ℝ(_y_) × 106). 1. If IsTemporalObject(_x_) is *true* or IsTemporalObject(_y_) is *true*, then 1. If SameTemporalType(_x_, _y_) is *false*, throw a *TypeError* exception. 1. Let _xFormatRecord_ be ? HandleDateTimeValue(_dateTimeFormat_, _x_). 1. Let _yFormatRecord_ be ? HandleDateTimeValue(_dateTimeFormat_, _y_). - 1. Let _tm1_ be ToLocalTime(ℤ(ℝ(_x_) × 106)_xFormatRecord_.[[EpochNanoseconds]], _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]). - 1. Let _tm2_ be ToLocalTime(ℤ(ℝ(_y_) × 106)_yFormatRecord_.[[EpochNanoseconds]], _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]). + 1. Let _xEpochNanoseconds_ be _xFormatRecord_.[[EpochNanoseconds]]. + 1. Let _yEpochNanoseconds_ be _yFormatRecord_.[[EpochNanoseconds]]. + 1. Let _tm1_ be ToLocalTime(_xEpochNanoseconds_, _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]). + 1. Let _tm2_ be ToLocalTime(_yEpochNanoseconds_, _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]). 1. Let _format_ be _dateTimeFormat_.[[DateTimeFormat]]. 1. Let _format_ be _xFormatRecord_.[[Format]]. 1. Assert: _format_ is equal to _yFormatRecord_.[[Format]]. @@ -1160,7 +854,7 @@

1. Set _relevantFieldsEqual_ to *false*. 1. If _relevantFieldsEqual_ is *true*, then 1. Let _collapsedResult_ be a new empty List. - 1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x_). + 1. Let _resultParts_ be FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _xEpochNanoseconds_). 1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do 1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"shared"* } to _collapsedResult_. 1. Return _collapsedResult_. @@ -1171,10 +865,10 @@

1. Let _pattern_ be _rangePatternPart_.[[Pattern]]. 1. Let _source_ be _rangePatternPart_.[[Source]]. 1. If _source_ is *"startRange"* or *"shared"*, then - 1. Let _z_ be _x_. + 1. Let _z_ be _xEpochNanoseconds_. 1. Else, - 1. Let _z_ be _y_. - 1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _selectedRangePattern_, _pattern_, _z_). + 1. Let _z_ be _yEpochNanoseconds_. + 1. Let _resultParts_ be FormatDateTimePattern(_dateTimeFormat_, _selectedRangePattern_, _pattern_, _z_). 1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do 1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: _source_ } to _rangeResult_. 1. Return _rangeResult_. @@ -1508,7 +1202,7 @@

1. If IsTimeZoneOffsetString(_timeZoneIdentifier_) is *true*, then 1. Let _offsetNs_ be ParseTimeZoneOffsetString! ParseDateTimeUTCOffset(_timeZoneIdentifier_). 1. Else, - 1. Assert: IsValidTimeZoneName(_timeZoneIdentifier_) is *true*. + 1. Assert: GetAvailableNamedTimeZoneIdentifier(_timeZoneIdentifier_) is not ~empty~. 1. Let _offsetNs_ be GetNamedTimeZoneOffsetNanoseconds(_timeZoneIdentifier_, _epochNs_). 1. Let _tz_ be ℝ(_epochNs_) + _offsetNs_. 1. If _calendar_ is *"gregory"*, then @@ -1578,55 +1272,6 @@

Intl.DateTimeFormat.prototype.formatRangeToParts ( _startDate_, _endDate_ )< 1. Return ? FormatDateTimeRangeToParts(_dtf_, _x_, _y_). - - -

Intl.DateTimeFormat.prototype.resolvedOptions ( )

- -

This function provides access to the locale and options computed during initialization of the object.

- - - 1. Let _dtf_ be the *this* value. - 1. If the implementation supports the normative optional constructor mode of , then - 1. Set _dtf_ to ? UnwrapDateTimeFormat(_dtf_). - 1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]). - 1. Let _format_ be _dtf_.[[DateTimeFormat]]. - 1. Let _options_ be OrdinaryObjectCreate(%Object.prototype%). - 1. For each row of , except the header row, in table order, do - 1. Let _p_ be the Property value of the current row. - 1. If there is an Internal Slot value in the current row, then - 1. Let _v_ be the value of _dtf_'s internal slot whose name is the Internal Slot value of the current row. - 1. If _p_ is neither *"hourCycle"* nor *"hour12"*, or if _format_ has a field [[hour]], then - 1. Let _v_ be the value of _dtf_'s internal slot whose name is the Internal Slot value of the current row. - 1. Else, - 1. Let _v_ be *undefined*. - 1. Else, - 1. Let _format_ be _dtf_.[[DateTimeFormat]]. - 1. If _format_ has a field [[<_p_>]] and _dtf_.[[DateStyle]] is *undefined* and _dtf_.[[TimeStyle]] is *undefined*, then - 1. Let _v_ be _format_.[[<_p_>]]. - 1. Else, - 1. Let _v_ be *undefined*. - 1. If _v_ is not *undefined*, then - 1. If there is a Conversion value in the current row, then - 1. Let _conversion_ be the Conversion value of the current row. - 1. If _conversion_ is ~hour12~, then - 1. If _v_ is *"h11"* or *"h12"*, set _v_ to *true*. Otherwise, set _v_ to *false*. - 1. Else, - 1. Assert: _conversion_ is ~number~. - 1. Set _v_ to 𝔽(_v_). - 1. Perform ! CreateDataPropertyOrThrow(_options_, _p_, _v_). - 1. Return _options_. - - -

For web compatibility reasons, if the property *"hourCycle"* is set, the *"hour12"* property should be set to *true* when *"hourCycle"* is *"h11"* or *"h12"*, or to *false* when *"hourCycle"* is *"h23"* or *"h24"*.

- - - In this version of the API, the *"timeZone"* property will be the identifier of the host environment's time zone if no *"timeZone"* property was provided in the options object provided to the Intl.DateTimeFormat constructor. The first edition left the *"timeZone"* property *undefined* in this case. - - - - For compatibility with versions prior to the fifth edition, the *"hour12"* property is set in addition to the *"hourCycle"* property. - -