TimeZoneInfo.TryConvertWindowsIdToIanaId Method

Definition

Overloads

TryConvertWindowsIdToIanaId(String, String)

Tries to convert a Windows time zone ID to an IANA ID.

TryConvertWindowsIdToIanaId(String, String, String)

Tries to convert a Windows time zone ID to an IANA ID.

TryConvertWindowsIdToIanaId(String, String)

Source:
TimeZoneInfo.cs
Source:
TimeZoneInfo.cs
Source:
TimeZoneInfo.cs

Tries to convert a Windows time zone ID to an IANA ID.

C#
public static bool TryConvertWindowsIdToIanaId(string windowsId, out string? ianaId);

Parameters

windowsId
String

The Windows time zone ID.

ianaId
String

When this method returns, contains the IANA ID that corresponds to the specified Windows ID.

Returns

true if the ID conversion succeeded, false otherwise.

Remarks

This API is exclusively supported on .NET 6.0 and later versions. It is also supported when the application utilizes the ICU library, otherwise the API will fail. However, in .NET, the ICU library is not always used by default, particularly in the following scenarios:

If the application is running on a Windows OS version that lacks the ICU library, it has the option to opt-in and enable the usage of the ICU library through the App-Local ICU feature.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10

TryConvertWindowsIdToIanaId(String, String, String)

Source:
TimeZoneInfo.cs
Source:
TimeZoneInfo.cs
Source:
TimeZoneInfo.cs

Tries to convert a Windows time zone ID to an IANA ID.

C#
public static bool TryConvertWindowsIdToIanaId(string windowsId, string? region, out string? ianaId);

Parameters

windowsId
String

The Windows time zone ID.

region
String

The ISO 3166 code for the country/region.

ianaId
String

When this method returns, contains the IANA ID that corresponds to the specified Windows ID.

Returns

true if the ID conversion succeeded, false otherwise.

Remarks

This API is exclusively supported on .NET 6.0 and later versions. It is also supported when the application utilizes the ICU library, otherwise the API will fail. However, in .NET, the ICU library is not always used by default, particularly in the following scenarios:

If the application is running on a Windows OS version that lacks the ICU library, it has the option to opt-in and enable the usage of the ICU library through the App-Local ICU feature.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10