Editare

Partajați prin


Clock.GmtTime Property

Definition

Gets a Date object that contains the current local date and time on the computer, expressed as a UTC (GMT) time.

public:
 property DateTime GmtTime { DateTime get(); };
public DateTime GmtTime { get; }
member this.GmtTime : DateTime
Public ReadOnly Property GmtTime As DateTime

Property Value

A Date object that contains the current date and time expressed as UTC (GMT) time.

Examples

This example uses the My.Computer.Clock.GmtTime property to display the GMT time of the computer on which the code runs.

MsgBox("Current GMT time: " & My.Computer.Clock.GmtTime)

Remarks

The My.Computer.Clock.GmtTime property has the same behavior as the DateTime.UtcNow property.

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library Yes
Windows Service Yes
Web Site Yes

Applies to

See also