Skip to content

Commit

Permalink
Normative: fix SystemTimeZoneIdentifier offsets
Browse files Browse the repository at this point in the history
This commit adds prose to clarify that if SystemTimeZoneIdentifier
returns an offset time zone identifier, then it should be in normal form
like "-05:00" not "-0500" nor "-05".

No current implementations support returning offset strings in non-
normal form today. So although this commit is normative, it won't
break any existing ECMAScript code nor will it require changes to
any current implementation.

Fixes #2584.
  • Loading branch information
justingrant committed Jun 28, 2023
1 parent b1b2476 commit d6b7059
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,9 @@ <h1>ISO 8601 grammar</h1>
UTCOffsetWithSubMinuteComponents[Extended] :
Sign Hour[+Padded] TimeSeparator[?Extended] MinuteSecond TimeSeparator[?Extended] MinuteSecond Fraction?

NormalizedUTCOffset :
ASCIISign Hour[+Padded] `:` MinuteSecond

UTCOffsetMinutePrecision :
Sign Hour[+Padded]
Sign Hour[+Padded] TimeSeparator[+Extended] MinuteSecond
Expand Down
2 changes: 1 addition & 1 deletion spec/mainadditions.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ <h1>SystemTimeZoneIdentifier ( ): a String</h1>

<emu-alg>
1. If the implementation only supports the UTC time zone, return *"UTC"*.
1. Let _systemTimeZoneString_ be the String representing the host environment's current time zone, either: a primary time zone identifier; or an offset time zone identifier.
1. [declared="s"] Let _systemTimeZoneString_ be the String representing the host environment's current time zone, either: a primary time zone identifier; or an offset time zone identifier<ins> String _s_ for which ParseText(StringToCodePoints(_s_), |NormalizedUTCOffset|) returns a Parse Node</ins>.
1. <del>If IsTimeZoneOffsetString(_systemTimeZoneString_) is *true*, return _systemTimeZoneString_.</del>
1. Return _systemTimeZoneString_.
</emu-alg>
Expand Down

0 comments on commit d6b7059

Please sign in to comment.