-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Description
Temporal.TimeZone.from("2021-01-05T16:37:40.840192769Z[Asia/Tokyo]");
// no exception??? TimeZone {_repr_: "Temporal.TimeZone <UTC>"}This behavior matches the spec, but:
- It seems really weird for the Z to win out over the explicit time zone annotation. I can't imagine the current behavior would ever be the caller's intent.
- This behavior seems contrary to the champions decision in Clarify TimeZone.from() #313 (comment), where a Z + IANA format was not shown in the list of acceptable formats.
- This string, if passed to
ZonedDateTime.from, should throw according to the spec, although IETF and interop concerns might prompt us to accept this format-- seeZonedDateTime.fromwhen the offset is "Z" (and an IANA name is present) #1695 for discussion.
IMHO this is a spec bug and seems worth a normative change. Returning the UTC timezone seems clearly misaligned with the caller's intention here. I think the correct behavior is to return a TimeZone created using the bracketed timezone annotation. (Or perhaps to throw depending on resolution of #1695.) UPDATE: Per 2020-08-21 decision in #1695, we'll accept this format in ZonedDateTime.from too.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels