Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

GmtTime Property

Location

My.Computer.Clock.GmtTime

Syntax

Dim result As Date = My.Computer.Clock.GmtTime

Description

The GmtTime property returns the current date and time as represented in Universal Coordinated Time (UTC), which is equivalent to Greenwich Mean Time (GMT).

Usage at a Glance

This property is read-only.

Example

The following code displays the current UTC time in a message box.

MsgBox("If you were in London, your watch would read " & _ Format(My.Computer.Clock.GmtTime, "HH:mm"))

Related Framework Entries

  • Microsoft.VisualBasic.Devices.Clock.GmtTime Property

  • System.DateTime.UtcNow Property

See Also

Clock Object, LocalTime Property, TickCount Property

Категории