TimeZoneInfo.TryConvertWindowsIdToIanaId 方法

定義

多載

TryConvertWindowsIdToIanaId(String, String)

嘗試將 Windows 時區識別碼轉換為 IANA 識別碼。

TryConvertWindowsIdToIanaId(String, String, String)

嘗試將 Windows 時區識別碼轉換為 IANA 識別碼。

TryConvertWindowsIdToIanaId(String, String)

來源:
TimeZoneInfo.cs
來源:
TimeZoneInfo.cs
來源:
TimeZoneInfo.cs

嘗試將 Windows 時區識別碼轉換為 IANA 識別碼。

public:
 static bool TryConvertWindowsIdToIanaId(System::String ^ windowsId, [Runtime::InteropServices::Out] System::String ^ % ianaId);
public static bool TryConvertWindowsIdToIanaId (string windowsId, out string? ianaId);
static member TryConvertWindowsIdToIanaId : string * string -> bool
Public Shared Function TryConvertWindowsIdToIanaId (windowsId As String, ByRef ianaId As String) As Boolean

參數

windowsId
String

Windows 時區識別碼。

ianaId
String

當這個方法傳回時,會包含對應至指定 Windows 識別碼的 IANA 識別碼。

傳回

true 如果識別碼轉換成功,則為 , false 否則為 。

備註

.NET 6.0 和更新版本僅支援此 API。 當應用程式利用 ICU 程式庫時也支援它,否則 API 將會失敗。 不過,在 .NET 中,預設不會一律使用 ICU 程式庫,特別是在下列案例中:

如果應用程式在缺少 ICU 程式庫的 Windows OS 版本上執行,可以加入宣告並透過 應用程式本機 ICU 功能啟用 ICU 程式庫的使用。

適用於

TryConvertWindowsIdToIanaId(String, String, String)

來源:
TimeZoneInfo.cs
來源:
TimeZoneInfo.cs
來源:
TimeZoneInfo.cs

嘗試將 Windows 時區識別碼轉換為 IANA 識別碼。

public:
 static bool TryConvertWindowsIdToIanaId(System::String ^ windowsId, System::String ^ region, [Runtime::InteropServices::Out] System::String ^ % ianaId);
public static bool TryConvertWindowsIdToIanaId (string windowsId, string? region, out string? ianaId);
static member TryConvertWindowsIdToIanaId : string * string * string -> bool
Public Shared Function TryConvertWindowsIdToIanaId (windowsId As String, region As String, ByRef ianaId As String) As Boolean

參數

windowsId
String

Windows 時區識別碼。

region
String

國家/地區的 ISO 3166 代碼。

ianaId
String

當這個方法傳回時,會包含對應至指定 Windows 識別碼的 IANA 識別碼。

傳回

true 如果識別碼轉換成功,則為 , false 否則為 。

備註

.NET 6.0 和更新版本僅支援此 API。 當應用程式利用 ICU 程式庫時也支援它,否則 API 將會失敗。 不過,在 .NET 中,預設不會一律使用 ICU 程式庫,特別是在下列案例中:

如果應用程式在缺少 ICU 程式庫的 Windows OS 版本上執行,可以加入宣告並透過 應用程式本機 ICU 功能啟用 ICU 程式庫的使用。

適用於