Export (0) Print
Expand All

DateAndTime.TimeOfDay Property

Returns or sets a Date value containing the current time of day according to your system.

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

public static DateTime TimeOfDay { get; }

Property Value

Type: System.DateTime
Gets a Date value containing the current time of day according to your system.

The Date data type includes date components. When returning the system time, TimeOfDay sets these all to 1, so the returned value represents the first day of the year 1. When setting the system time, TimeOfDay ignores the date components.

To access the current system time as a String, use the TimeString property.

To get the current system date, use the Today property.

This example uses the TimeOfDay property to return the current system time.


Dim currentTime As Date
currentTime = TimeOfDay


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft