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

LocalTime Property

Location

My.Computer.Clock.LocalTime

Syntax

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

Description

The LocalTime property returns the current date and time as represented by the current time zone settings.

Usage at a Glance

This property is read-only.

Example

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

MsgBox("Look at your watch; it's " & _ Format(My.Computer.Clock.LocalTime, "h:mm tt"))

Related Framework Entries

  • Microsoft.VisualBasic.Devices.Clock.LocalTime Property

  • System.DateTime.Now Property

See Also

Clock Object, GmtTime Property, TickCount Property

Категории