Skip to content

TimeZone.from with ISO strings that have both Z and IANA name #1696

@justingrant

Description

@justingrant
Temporal.TimeZone.from("2021-01-05T16:37:40.840192769Z[Asia/Tokyo]");
// no exception??? TimeZone {_repr_: "Temporal.TimeZone <UTC>"}

This behavior matches the spec, but:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions