|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Date and Time for Visual Basic 6.0 Users
Visual Basic 2005 updates the Date, Date$, Time, and Time$ functions, and replaces the Now and Timer functions with properties.
Visual Basic 6.0
In Visual Basic 6.0, the Date and Time functions return the system date and time in the four-byte Date format. Similarly, the Date and Time statements use the Visual Basic 6.0 format to set the system date and time.
The Date$ and Time$ functions return the system date and time in String format.
The Now and Timer functions specify the current date and time and the number of seconds elapsed since midnight.
Visual Basic 2005
Visual Basic 2005 replaces Date and Time with the Today and TimeOfDay properties, which use the eight-byte common language runtime (CLR)structure. This corresponds with the Date data type in Visual Basic 2005. You can use Today and TimeOfDay to both set and fetch the system date and time.
Visual Basic 2005 replaces the Date$ and Time$ functions with the DateString and TimeString properties. You can use DateString and TimeString to both set and fetch the system date and time.
The Now and Timer functions are replaced by read-only properties of the same names. Their calling sequences remain unchanged.