Date Statement

Description

Sets the current system date.

Syntax

Date = date

For MS-DOS computers, the date argument must be a date from January 1, 1980 through December 31, 2099, or an error occurs. For the Macintosh, date must be a date from January 1, 1904 through December 31, 2040. For all other systems, date is limited to dates from January 1, 100 through December 31, 9999.

Remarks

Note

If you use the Date statement to set the date on computers using versions of MS-DOS earlier than version 3.3, the change remains in effect only until you change it again or turn off your computer. Many computers have a battery-powered CMOS RAM that retains date and time information when the computer is turned off. However, to permanently change the date on computers running earlier versions of MS-DOS, you may have to use your Setup disk or perform some equivalent action. Refer to the documentation for your particular system.

See Also

Date Function, Time Function, Time Statement.

Example

This example uses the Date statement to set the computer system date.


' In the development environment, the date literal will display in short 
' format using the locale settings of your code.
MyDate = #February 12, 1985#    ' Assign a date.
Date = MyDate    ' Change system date.