Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
TimeOfDay Property

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)

'Declaration
Public Shared ReadOnly Property TimeOfDay As DateTime

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:
© 2015 Microsoft