Clock.GmtTime 属性

定义

获取一个 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 服务
网站

适用于

另请参阅