FindSystemTimeZoneById doesn't return new object
The TimeZoneInfo object returned by FindSystemTimeZoneById(String) is now a cached TimeZoneInfo
instance instead of a new object.
Previous behavior
TimeZoneInfo.FindSystemTimeZoneById(String) returned a new TimeZoneInfo
object.
New behavior
Starting in .NET 8, TimeZoneInfo.FindSystemTimeZoneById(String) returns a cached TimeZoneInfo
instance.
Version introduced
.NET 8
Type of breaking change
This change is a behavioral change.
Reason for change
This change was made to improve performance when calling FindSystemTimeZoneById(String). For more information, see dotnet/runtime pull request #85615.
Recommended action
If your code relied on FindSystemTimeZoneById(String) to create a new instance of TimeZoneInfo
, refactor the code to call one of these methods instead.
Affected APIs
Обратна връзка
https://aka.ms/ContentUserFeedback.
Очаквайте скоро: През цялата 2024 г. постепенно ще отстраняваме проблемите в GitHub като механизъм за обратна връзка за съдържание и ще го заменим с нова система за обратна връзка. За повече информация вижте:Подаване и преглед на обратна връзка за