语言

TimeZone.CurrentTimeZone 属性

定义

获取当前计算机的时区。

public:
 static property TimeZone ^ CurrentTimeZone { TimeZone ^ get(); };
public static TimeZone CurrentTimeZone { get; }
static member CurrentTimeZone : TimeZone
Public Shared ReadOnly Property CurrentTimeZone As TimeZone

属性值

一个 TimeZone 表示当前本地时区的对象。

注解

该 CurrentTimeZone 属性对应于该 TimeZoneInfo.Local 属性。 尽可能使用该 TimeZoneInfo.Local 属性。

调用方说明

在本地时区数据首先用于检索时区信息之后 CurrentTimeZone 进行缓存。 如果系统的本地时区随后发生更改,则 CurrentTimeZone 属性不会反映此更改。 如果需要在应用程序运行时处理时区更改,请使用 TimeZoneInfo 类并调用其 ClearCachedData() 方法。

适用于

另请参阅