Visual Basic Language Reference  

Today Property

Returns or sets a Date value containing the current date according to your system.

Public Property Today() As DateTime

Remarks

The Date data type includes time components. When returning the system date, Today sets all of these to 0, so the returned value represents midnight (00:00:00). When setting the system date, Today ignores the time components.

To access the current system date as a String, use the DateString property.

To get or set the current system time, use the TimeOfDay property.

Example

This example uses the Today property to return the current system date.

Dim MyDate As Date
MyDate = Today   ' Return current system date.

See Also

Format Function | Now Property | DateString Property | TimeOfDay Property | System Namespace | DateTime Structure | ArgumentOutOfRangeException Class