[Breaking change]: FindSystemTimeZoneById Returns Incorrect StandardName for Id #41830
Closed
3 tasks
Labels
breaking-change
Indicates a .NET Core breaking change
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
⌚ Not Triaged
Not triaged
Description
It looks like the TimeZoneInfo object that is returned from FindSystemTimeZoneById() is returning an incorrect name for a given ID (It gives the correct offset but with "GMT"). Further, it seems to only be a problem for IDs that are shaped like "Eastern Standard Time". In contrast, "America/New_York" works fine.
I suspect that this has something to do with the caching behavior introduced in .NET 8. Take a look at the unit test below, which will fail in different ways depending on the test cases provided
Unit test to reproduce behavior:
Version
.NET 8 GA
Previous behavior
The standard name should be analogous the provided time zone.
New behavior
The standard name is set to GMT
Type of breaking change
Reason for change
N/A
Recommended action
Seems like the America/X IDs are working properly. Use those instead
Feature area
Core .NET libraries
Affected APIs
TimeZoneInfo.FindSystemTimeZoneById(String)
The text was updated successfully, but these errors were encountered: