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 Microsoft Windows NT™ computers, date must be a date from January 1, 1980 through December 31, 2079.

Remarks

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 is displayed in short date format using the locale settings of your code.


MyDate = #February 12, 1985#                    ' Assign a date.= MyDate                                ' Change system date.