Clock Class

 

Provides properties for accessing the current local time and Universal Coordinated Time (equivalent to Greenwich Mean Time) from the system clock.

Namespace:   Microsoft.VisualBasic.Devices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

System.Object
  Microsoft.VisualBasic.Devices.Clock

[HostProtectionAttribute(SecurityAction.LinkDemand, Resources = HostProtectionResource.ExternalProcessMgmt)]
public class Clock

NameDescription
System_CAPS_pubmethodClock()

Initializes a new instance of the Clock class.

NameDescription
System_CAPS_pubpropertyGmtTime

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

System_CAPS_pubpropertyLocalTime

Gets a Date object that contains the current local date and time on this computer.

System_CAPS_pubpropertyTickCount

Gets the millisecond count from the computer's system timer.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The My.Computer.Clock object provides properties to find the current local time for the computer and the UTC time. It also exposes the millisecond count from the computer's system timer.

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

MsgBox("Current local time: " & My.Computer.Clock.LocalTime)

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: