-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
Milestone
Description
Description
Using Blazor WASM with .NET 5, the information in TimeZoneInfo.DaylightName is incorrect and appears to mirror the TimeZoneInfo.StandardName.
Actual Behavior:
TimeZoneInfo.DaylightName is identical to TimeZoneInfo.StandardName.
For example using this code
@foreach (var tz in TimeZoneInfo.GetSystemTimeZones().OrderBy(tz => tz.BaseUtcOffset))
{
<tr>
<td>@tz.Id</td><td>@tz.DisplayName</td><td>@tz.StandardName</td>
<td>@tz.SupportsDaylightSavingTime</td><td>@tz.DaylightName</td>
<td>@tz.BaseUtcOffset</td>
</tr>
}
produces
Expected Behavior:
TimeZoneInfo.DaylightName is different (and correct) for time zones that support daylight saving time.
For example, in a .NET 5 console application the same values look like this:

Pacific Standard time in a .NET 5 console app shows that the StandardName is "Pacific Standard Time" and the DaylightName is "Pacific Daylight Time"
This may be partially related to #44840
Configuration
- NET 5
- Blazor WASM
- Windows 10
- Chrome 86
- Project settings looks like this:
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
</PropertyGroup>
Regression?
This is a regression from Blazor WASM 3.2, which produces this result

Other information
- I realize the time zone source may have changed, but the DisplayName field seems clunky as well compared to the Blazor WASM 3.2 version.
- Along with TimeZoneInfo.GetSystemTimeZones produces unexpected results in Blazor WASM for .NET 5 #44840. even with the project setting of
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>I can only get 14 time zones to display, and they are seemingly random.
Reactions are currently unavailable
