Chapter
10
I
BASIC Ke-ywords
DATE$
Function
DATE$[
=
string]
Sets the date or retrieves the current date.
String
is
a literal, enclosed in quotation marks, that sets the
current date by assigning a value to DATE$. If you omit
string,
BASIC retrieves the current date.
Setting the Date
BASIC uses the same dates as MS-DOS, January
1,
1980
to
De-
cember 31, 2099. You may use either
a
slash or a hyphen
to
sep-
arate the month, day, and year. You may use any of the following
forms to set the current date:
mmlddlyy mmlddlyyyy
mm-dd-yy
mm
-dd-YYYY
The
month
(mm)
may be any number 01-12.
The day
(dd)
may be any number 01-31.
The year
(yy
or
yyyy)
may be 01-99 or 1980-2099.
You may omit leading zeroes for the month and day. If you only
supply 2 digits
for
the year, BASIC precedes these digits with
19.
Retrieving the Date
Regardless
of
the form you use
to
set the date, BASIC retrieves
the date in the following form:
mm-dd-y y y y
The month and day are always returned
as
2 digits, BASIC in-
serts zeroes
as
necessary.
134