Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DATE$ Function and DATE$ Statement Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
' This example uses the DATE$ statement to set the system date on your
' computer to the new date you enter.
' Note: If you change the system date, any files you create or revise will
' be stamped with the new date. Make sure to reset the system date to the
' current date.
' To try this example:
' 1. Choose New Project from the File menu
' 2. Copy the code example below to the code window
' 3. Press F5 to run the example
CLS ' Clear the screen
PRINT "The current system date is set to: " + DATE$
PRINT
PRINT "Enter the date below (default year is 1992)."
INPUT " Month: ", Month$
INPUT " Date: ", Day$
INPUT " Year: ", Year$
IF Year$ = "" THEN Year$ = "92"
DATE$ = Month$ + CHR$(47) + Day$ + CHR$(47) + Year$
PRINT
PRINT "The system date has been set to: " + DATE$