-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix TimeZone Names #106038
Fix TimeZone Names #106038
Conversation
Tagging subscribers to this area: @dotnet/area-system-datetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
/backport to 8.0-staging |
Started backporting to 8.0-staging: https://github.com/dotnet/runtime/actions/runs/10275576890 |
@tarekgh an error occurred while backporting to 8.0-staging, please check the run log for details! The process '/usr/bin/git' failed with exit code 1 |
In .NET 8.0 we have done some optimization work to delay initializing the time zone names (Standard, Daylight, and Display names). The reason is the names initialization is extremely expensive especially on non-Windows OS's because we do some heuristics and call ICU to extract such names. Unintentionally doing names lazy initialization on non-Windows OS's caused a problem with the time zones created using Windows Ids e.g.
Eastern Standard Time
. The reason is to get the correct names of the time zone you need to call ICU using the IANA ids e.g.America/New_York
which not done with the lazy initialization. The fix here is to ensure using the IANA ids on non-Windows OS's when requesting the names from ICU.The repro of the issue, on Linux use code like:
This code will display names like
GMT
which are wrong as expected to show something likeEastern Standard Time: Eastern Standard Time ... Eastern Standard Time ... Eastern Daylight Time
.