Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WASM] TimeZoneInfo UTC display names #50305

Closed
mattjohnsonpint opened this issue Mar 26, 2021 · 4 comments · Fixed by #50650
Closed

[WASM] TimeZoneInfo UTC display names #50305

mattjohnsonpint opened this issue Mar 26, 2021 · 4 comments · Fixed by #50650
Labels
arch-wasm WebAssembly architecture area-System.DateTime untriaged New issue has not been triaged by the area owner

Comments

@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Mar 26, 2021

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

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 26, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@mattjohnsonpint mattjohnsonpint changed the title [WASM] TimeZoneInfo display names [WASM] TimeZoneInfo UTC display names Mar 26, 2021
@tarekgh tarekgh added arch-wasm WebAssembly architecture area-System.Runtime labels Mar 26, 2021
@ghost
Copy link

ghost commented Mar 26, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

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)?

@tarekgh @lewing @eerhardt

Author: mattjohnsonpint
Assignees: -
Labels:

arch-wasm, area-System.Runtime, untriaged

Milestone: -

@eerhardt
Copy link
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.

@mattjohnsonpint
Copy link
Contributor Author

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 ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 2, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 7, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.DateTime untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants