Clock.GmtTime 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个 Date 对象,该对象包含计算机上的当前本地日期和时间,以 UTC (GMT) 时间表示。
public:
property DateTime GmtTime { DateTime get(); };
public DateTime GmtTime { get; }
member this.GmtTime : DateTime
Public ReadOnly Property GmtTime As DateTime
属性值
一个 Date 对象,该对象包含以 UTC (GMT) 时间表示的当前日期和时间。
示例
此示例使用 My.Computer.Clock.GmtTime 该属性显示运行代码的计算机的 GMT 时间。
MsgBox("Current GMT time: " & My.Computer.Clock.GmtTime)
注解
该 My.Computer.Clock.GmtTime 属性的行为与 DateTime.UtcNow 属性相同。
按项目类型提供可用性
| 项目类型 | 可用 |
|---|---|
| Windows 应用程序 | 是的 |
| 类库 | 是的 |
| 控制台应用程序 | 是的 |
| Windows 控件库 | 是的 |
| Web 控件库 | 是的 |
| Windows 服务 | 是的 |
| 网站 | 是的 |