Skip to content

Commit 92305c1

Browse files
committed
Rename "canonical" to "primary" tz identifier term
We were concerned that "canonical time zone identifier" is too strong, and that a less-prescriptive term may work better. This is broken out into a separate commit in case we (or others on TC39) want to revert to the previous "canonical" term.
1 parent f27dc8b commit 92305c1

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

spec.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32101,11 +32101,11 @@ <h1>Time Zone Identifiers</h1>
3210132101
ECMAScript identifies time zones using the Zone and Link names of the IANA Time Zone Database <a href="https://www.iana.org/time-zones/">https://www.iana.org/time-zones/</a>.
3210232102
These names are called <dfn variants="time zone identifier">time zone identifiers</dfn>, and are Strings composed entirely of characters from the Basic Latin Unicode block.
3210332103
Time zone identifiers are case-insensitive and so are compared using ASCII case-insensitive comparisons, but time zone identifiers returned by ECMAScript built-in objects always use the casing found in the IANA Time Zone Database.
32104-
A <dfn id="canonical-time-zone-identifier" variants="canonical time zone identifiers">canonical time zone identifier</dfn> is a Zone name, and a <dfn variants="non-canonical time zone identifiers">non-canonical time zone identifier</dfn> is a Link name, respectively, in the IANA Time Zone Database except as specifically overridden by AvailableTimeZoneIdentifiers.
32104+
A <dfn id="primary-time-zone-identifier" variants="primary time zone identifiers">primary time zone identifier</dfn> is a Zone name, and a <dfn variants="non-primary time zone identifiers">non-primary time zone identifier</dfn> is a Link name, respectively, in the IANA Time Zone Database except as specifically overridden by AvailableTimeZoneIdentifiers.
3210532105
The set of Zone and Link identifiers that are supported by an ECMAScript implementation are called available time zone identifiers.
3210632106
</p>
3210732107

32108-
<p>In the IANA Time Zone Database, the UTC time zone is represented by the Zone *"Etc/UTC"*, but for backwards compatibility and brevity reasons, *"UTC"* is the canonical identifier used for this time zone in ECMAScript, while *"Etc/UTC"*, *"GMT"*, and *"Etc/GMT"* are all non-canonical identifiers that resolve to *"UTC"*.</p>
32108+
<p>In the IANA Time Zone Database, the UTC time zone is represented by the Zone *"Etc/UTC"*, but for backwards compatibility and brevity reasons, *"UTC"* is the primary identifier used for this time zone in ECMAScript, while *"Etc/UTC"*, *"GMT"*, and *"Etc/GMT"* are all non-primary identifiers that resolve to *"UTC"*.</p>
3210932109

3211032110
<p>
3211132111
<dfn id="time-zone-aware">Time zone aware</dfn> ECMAScript implementations support *"UTC"* and local political rules of time zones represented by all other Zone and Link names (and <strong>only</strong> such names) from the IANA Time Zone Database.
@@ -32114,7 +32114,7 @@ <h1>Time Zone Identifiers</h1>
3211432114
Fruthermore, even non-time zone aware implementations that do not support the entire IANA Time Zone Database are still recommended to use IANA Time Zone Database identifiers to represent time zones.
3211532115
</p>
3211632116

32117-
<p>ECMAScript implementations that do not include local political rules for any time zones must support at least one available time zone identifier, *"UTC"*, which must be canonical.</p>
32117+
<p>ECMAScript implementations that do not include local political rules for any time zones must support at least one available time zone identifier, *"UTC"*, which must be primary.</p>
3211832118

3211932119
<p>
3212032120
Time zone identifiers in the IANA Time Zone Database can change over time.
@@ -32124,21 +32124,21 @@ <h1>Time Zone Identifiers</h1>
3212432124

3212532125
<p>
3212632126
The IANA Time Zone Database is typically updated between five and ten times per year, so it is recommended to use the best available current and historical time zone information.
32127-
This information includes which identifiers are supported, the canonical time zone identifier associated with any identifier, and the UTC offsets and transitions associated with any Zone.
32127+
This information includes which identifiers are supported, the primary time zone identifier associated with any identifier, and the UTC offsets and transitions associated with any Zone.
3212832128
</p>
3212932129

3213032130
<p>
3213132131
When time zone information is updated, it is recommended that implementations maintain a fully consistent copy of the IANA Time Zone Database for the lifetime of each agent.
32132-
If implementations do revise time zone information during the lifetime of an agent, then it is recommended that changes to time zone data, including which identifiers are supported, the canonical time zone identifier associated with any identifier, and the UTC offsets and transitions associated with any Zone, can be incorporated into an agent only if they are consistent with results already observed by all ECMAScript code that can reach that agent.
32133-
For example, it is recommended that a new identifier can be incorporated only if no ECMAScript code has already tried to use it, and it is recommended that replacement of a canonical identifier with a Link to a different identifier can only be incorporated only if no ECMAScript code has already resulted in resolving it as canonical.
32132+
If implementations do revise time zone information during the lifetime of an agent, then it is recommended that changes to time zone data, including which identifiers are supported, the primary time zone identifier associated with any identifier, and the UTC offsets and transitions associated with any Zone, can be incorporated into an agent only if they are consistent with results already observed by all ECMAScript code that can reach that agent.
32133+
For example, it is recommended that a new identifier can be incorporated only if no ECMAScript code has already tried to use it, and it is recommended that replacement of a primary identifier with a Link to a different identifier can only be incorporated only if no ECMAScript code has already resulted in resolving it as primary.
3213432134
The complexity of maintaining such invariants is why it is recommended that implementations maintain a fully consistent copy of the IANA Time Zone Database for the lifetime of each agent.
3213532135
</p>
3213632136

3213732137
<p>
32138-
The IANA Time Zone Database offers build options that affect which time zone identifiers are canonical.
32139-
It is recommended that ECMAScript implementations <strong>should not</strong> determine which identifiers are canonical and non-canonical using the data generated by the default build options of the IANA Time Zone Database, because those default build options merge geographically unrelated time zones together, such as *"Atlantic/Reykjavik"* as a Link to the Zone *"Africa/Abidjan"*.
32138+
The IANA Time Zone Database offers build options that affect which time zone identifiers are primary.
32139+
It is recommended that ECMAScript implementations <strong>should not</strong> determine which identifiers are primary and non-primary using the data generated by the default build options of the IANA Time Zone Database, because those default build options merge geographically unrelated time zones together, such as *"Atlantic/Reykjavik"* as a Link to the Zone *"Africa/Abidjan"*.
3214032140
These merges can be problematic because geographically and politically distinct locations, especially across country boundaries, are more likely to introduce divergent time zone rules in a future version of the IANA Time Zone Database.
32141-
Therefore, it is recommended that all identifiers listed in the IANA Time Zone Database's <code>zone.tab</code> file (which lists at least one Link or Zone name for each <a href="https://www.iso.org/glossary-for-iso-3166.html">ISO 3166-1 Alpha-2</a> country code in the IANA Time Zone Database) should be canonical identifiers.
32141+
Therefore, it is recommended that all identifiers listed in the IANA Time Zone Database's <code>zone.tab</code> file (which lists at least one Link or Zone name for each <a href="https://www.iso.org/glossary-for-iso-3166.html">ISO 3166-1 Alpha-2</a> country code in the IANA Time Zone Database) should be primary identifiers.
3214232142
One way to achieve this result is to build the IANA Time Zone Database with the <code>PACKRATDATA=backzone PACKRATLIST=zone.tab</code> build options.
3214332143
</p>
3214432144
</emu-clause>
@@ -32204,14 +32204,14 @@ <h1>
3220432204

3220532205
<emu-clause id="sec-availabletimezoneidentifiers" type="implementation-defined abstract operation">
3220632206
<h1>
32207-
AvailableTimeZoneIdentifiers (): a List of Records with fields [[Identifier]] (a String value that is a time zone identifier) and [[CanonicalIdentifier]] (a String value that is a canonical time zone identifier)
32207+
AvailableTimeZoneIdentifiers (): a List of Records with fields [[Identifier]] (a String value that is a time zone identifier) and [[PrimaryIdentifier]] (a String value that is a primary time zone identifier)
3220832208
</h1>
3220932209
<dl class="header">
3221032210
<dt>description</dt>
3221132211
<dd>
32212-
It returns a List of Records describing all available time zone identifiers in this implementation, as well as the canonical time zone identifier corresponding to each available identifier.
32212+
It returns a List of Records describing all available time zone identifiers in this implementation, as well as the primary time zone identifier corresponding to each available identifier.
3221332213
The List is sorted by [[Identifier]].
32214-
If an identifier is <emu-xref href="#canonical-time-zone-identifier">canonical</emu-xref>, then [[Identifier]] will be [[CanonicalIdentifier]].
32214+
If an identifier is <emu-xref href="#primary-time-zone-identifier">primary</emu-xref>, then [[Identifier]] will be [[PrimaryIdentifier]].
3221532215
</dd>
3221632216
</dl>
3221732217

@@ -32222,14 +32222,14 @@ <h1>
3222232222
1. [declared="comparefn"] Sort _identifiers_ in order as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_.
3222332223
1. Let _result_ be an empty List.
3222432224
1. For each element _identifier_ of _identifiers_, do
32225-
1. Let _canonical_ be _identifier_.
32226-
1. If _identifier_ is a non-canonical time zone identifier and _identifier_ is not *"UTC"*, then
32227-
1. Set _canonical_ to the name of the canonical time zone identifier that _identifier_ resolves to in the IANA Time Zone Database.
32228-
1. NOTE: If _identifier_ resolves to another non-canonical time zone identifier, then the implementation must continue resolution of the entire chain until its terminal canonical time zone identifier.
32229-
1. If _canonical_ is one of *"Etc/UTC"*, *"Etc/GMT"*, or *"GMT"*, set _canonical_ to *"UTC"*.
32230-
1. Let _record_ be the Record { [[Identifier]]: _identifier_, [[CanonicalIdentifier]]: _canonical_ }.
32225+
1. Let _primary_ be _identifier_.
32226+
1. If _identifier_ is a non-primary time zone identifier and _identifier_ is not *"UTC"*, then
32227+
1. Set _primary_ to the name of the primary time zone identifier that _identifier_ resolves to in the IANA Time Zone Database.
32228+
1. NOTE: If _identifier_ resolves to another non-primary time zone identifier, then the implementation must continue resolution of the entire chain until its terminal primary time zone identifier.
32229+
1. If _primary_ is one of *"Etc/UTC"*, *"Etc/GMT"*, or *"GMT"*, set _primary_ to *"UTC"*.
32230+
1. Let _record_ be the Record { [[Identifier]]: _identifier_, [[PrimaryIdentifier]]: _primary_ }.
3223132231
1. Append _record_ to the end of _result_.
32232-
1. Assert: One element of _result_ is { [[Identifier]]: *"UTC"*, [[CanonicalIdentifier]]: *"UTC"* }.
32232+
1. Assert: One element of _result_ is { [[Identifier]]: *"UTC"*, [[PrimaryIdentifier]]: *"UTC"* }.
3223332233
1. Return _result_.
3223432234
</emu-alg>
3223532235

@@ -32245,7 +32245,7 @@ <h1>HostTimeZoneIdentifier ( ): a String</h1>
3224532245
<dl class="header">
3224632246
<dt>description</dt>
3224732247
<dd>
32248-
It returns a String value representing the host environment's current time zone, which is either a String representing a UTC offset for which IsTimeZoneOffsetString returns *true*, or a canonical time zone identifier.
32248+
It returns a String value representing the host environment's current time zone, which is either a String representing a UTC offset for which IsTimeZoneOffsetString returns *true*, or a primary time zone identifier.
3224932249
</dd>
3225032250
</dl>
3225132251

@@ -32254,7 +32254,7 @@ <h1>HostTimeZoneIdentifier ( ): a String</h1>
3225432254
1. Let _hostTimeZoneString_ be the string representing the host environment's current time zone, either a time zone identifier or a UTC offset string.
3225532255
1. If IsTimeZoneOffsetString(_hostTimeZoneString_) is *true*, return _hostTimeZoneString_.
3225632256
1. Assert: GetAvailableTimeZoneIdentifier(_hostTimeZoneString_) is not ~empty~.
32257-
1. Assert: GetAvailableTimeZoneIdentifier(_hostTimeZoneString_).[[Identifier]] is GetAvailableTimeZoneIdentifier(_hostTimeZoneString_).[[CanonicalIdentifier]].
32257+
1. Assert: GetAvailableTimeZoneIdentifier(_hostTimeZoneString_).[[Identifier]] is GetAvailableTimeZoneIdentifier(_hostTimeZoneString_).[[PrimaryIdentifier]].
3225832258
1. Return _hostTimeZoneString_.
3225932259
</emu-alg>
3226032260

@@ -32271,7 +32271,7 @@ <h1>HostTimeZoneIdentifier ( ): a String</h1>
3227132271
<h1>
3227232272
GetAvailableTimeZoneIdentifier (
3227332273
_timeZone_: a String value,
32274-
): either a Record with fields [[Identifier]] (a String value that is a time zone identifier) and [[CanonicalIdentifier]] (a String value that is a canonical time zone identifier), or ~empty~
32274+
): either a Record with fields [[Identifier]] (a String value that is a time zone identifier) and [[PrimaryIdentifier]] (a String value that is a primary time zone identifier), or ~empty~
3227532275
</h1>
3227632276

3227732277
<dl class="header">
@@ -32288,7 +32288,7 @@ <h1>
3228832288
</emu-alg>
3228932289
<emu-note>
3229032290
Given the same value of _timeZone_ or any value that is an ASCII-case-insensitive match for it, it is recommended that the resulting Record contain the same property values for the lifetime of the surrounding agent.
32291-
Furthermore, it is recommended that time zone identifiers do not dynamically change from canonical to non-canonical, meaning that if _timeZone_ is a case-insensitive match for the [[CanonicalIdentifier]] property of the result of a previous call to GetAvailableTimeZoneIdentifier, then GetAvailableTimeZoneIdentifier(_timeZone_) will return a record where [[Identifier]] is [[CanonicalIdentifier]].
32291+
Furthermore, it is recommended that time zone identifiers do not dynamically change from primary to non-primary, meaning that if _timeZone_ is a case-insensitive match for the [[PrimaryIdentifier]] property of the result of a previous call to GetAvailableTimeZoneIdentifier, then GetAvailableTimeZoneIdentifier(_timeZone_) will return a record where [[Identifier]] is [[PrimaryIdentifier]].
3229232292
Due to the complexity of supporting these requirements, it is recommended that the result of AvailableTimeZoneIdentifiers (and therefore GetAvailableTimeZoneIdentifier) remains the same for the lifetime of the surrounding agent.
3229332293
</emu-note>
3229432294
</emu-clause>

0 commit comments

Comments
 (0)