TimeZoneInfo.TryConvertIanaIdToWindowsId(String, String) 方法

定义

尝试将 IANA 时区 ID 转换为 Windows ID。

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 时区 ID。

windowsId
String

此方法返回时,包含与指定的 IANA ID 对应的Windows ID。

返回

如果 ID 转换成功,则为 ;否则为 />。

注解

仅当应用程序使用 ICU 库时,.NET 6 及更高版本才支持此 API。 但是,在.NET中,ICU 库并非始终默认使用,尤其是在以下方案中:

如果应用程序在缺少 ICU 库的 Windows OS 版本上运行,可以选择加入并通过 app-local ICU 功能启用 ICU 库的使用。

适用于