You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"?
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.
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.
ghost added
in-prThere is an active PR which will close this issue when it is merged
Activity
[-][WASM] TimeZoneInfo display names[/-][+][WASM] TimeZoneInfo UTC display names[/+]eerhardt commentedon Mar 29, 2021
It doesn't sound that hard to make this consistent on
browser-wasm, right? I think in an ideal world it would probably just beUTCto be consistent with the other time zones -PST,EDT, etc.mattjohnsonpint commentedon Mar 29, 2021
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.