TimeZoneInfo.TryFindSystemTimeZoneById(String, TimeZoneInfo) 方法

定義

TimeZoneInfo依時區名稱擷取 物件。

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

參數

id
String

時區名稱。

timeZoneInfo
TimeZoneInfo

當這個方法傳回時,會包含已擷取 TimeZoneInfo 的 , null 如果找不到有效的時區,則為 。

傳回

trueTimeZoneInfo如果已成功擷取物件,則為 , false 否則為 。

備註

此函式會包裝讓私人 SystemTimeZones 快取保持運作順序所需的邏輯。

適用於