Skip to content

[WASM] TimeZoneInfo UTC display names #50305

Closed

Description

@mattjohnsonpint

I am reminded of something I should have brought with #48931, but need feedback before submitting a PR.

With the browser (or whenever we don't have full ICU), most time zones will get their StandardName and DaylightName from the IANA time zone abbreviations (example: "PST", "PDT"), and their DisplayName will be the base offset plus the IANA time zone ID (example: "(UTC-08:00) America/Los_Angeles").

However - for UTC and its aliases (Etc/UTC, and others), we have the hardcoded invariant string "Coordinated Universal Time", which we use for both the StandardName and DaylightName, and we use that to build "(UTC) Coordinated Universal Time" for the DisplayName. These strings are the same across platforms as a fallback value when globalization data is not available or when in invariant mode or using CultureInfo.InvariantCulture, etc.

This all works fine, but when iterating a list of time zones from GetSystemTimeZones with the browser target, all will be of the same format except UTC which will stand out.

My question is - do we want that behavior? Or should UTC use the same format as all the other zones for the browser (and others where ICU time zone names aren't available)? In other words, should the StandardName and DaylightName be "UTC" and the display name be "(UTC) Etc/UTC"?

@tarekgh @lewing @eerhardt

Activity

  1. ghost added
    untriaged
    on Mar 26, 2021
  2. changed the title [-][WASM] TimeZoneInfo display names[/-] [+][WASM] TimeZoneInfo UTC display names[/+] on Mar 26, 2021
  3. eerhardt commented on Mar 29, 2021

    @eerhardt
    Member

    It doesn't sound that hard to make this consistent on browser-wasm, right? I think in an ideal world it would probably just be UTC to be consistent with the other time zones - PST, EDT, etc.

  4. mattjohnsonpint commented on Mar 29, 2021

    @mattjohnsonpint
    ContributorAuthor

    It's not difficult at all, no. I just wasn't sure whether it was more important to match the other platforms or to match the other string formats of this platform. Sounds like the latter is preferred. I'll send a PR at some point.

  5. ghost added
    in-pr
    on Apr 2, 2021
  6. ghost removed
    in-pr
    on Apr 7, 2021
  7. ghost locked as resolved and limited conversation to collaborators on May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-System.DateTimeuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions