DATE$

Format

string1 = DATE$

Description

This function returns the value of the system date in the format of "MM-DD- YYYY".

Example

A$=DATE$
PRINT A$
After executing these statements, the date stored in the PC System Clock will be displayed on the screen.

Comments

Note: if the date printed is wrong, you have probably not set the system clock. Most older XTs and PCs do not have a battery to preserve the DATE and TIME in the system clock, so you have to set them each time you power up the PC. Most ATs and newer PCs have a battery backup, so that the date is preserved for you.

Unlike GWBASIC/BASICA, you cannot set the system date with DATE$, however, you can set the system date from DOS by typing DATE.

See Also

  • TIME$
  • TIMER