TimeZoneInfo.TryConvertIanaIdToWindowsId(String, String) 方法

定義

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

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

參數

ianaId
String

IANA 時區識別碼。

windowsId
String

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

傳回

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

備註

只有應用程式使用 ICU 程式庫時,.NET 6 和更新版本才支援此 API。 不過,在 .NET 中,ICU 程式庫預設不會一律使用,特別是在下列案例中:

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

適用於