DATE
DATE
[mm-dd-yyyy]
Chapter 6 / Command Reference
Internal
r-:
,
, .
i .
l ;
r-
I •
I
~
i .
,..----
,
, ,
Enters
or changes
the
system date. This date is recorded
in
the
directory
for
any files you create or change.
You
can also use
this
command to display
the
current date.
MS-DOS is programmed to change
the
months and years cor-
rectly,
taking
into account leap years and
the
number of days
in
the
months.
Parameters
mm-dd-yyyy
specifies
the
date
in
numerical form.
mm
(month) is
a one- or two-digit number
in
the
range 1-12.
dd
(day of month)
is a one- or two-digit number from 1-31.
yyyy (year) is a two-
digit number
in
the
range 80-99 (1980 is assumed) or a four-
digit number
in
the
range 1980-2099.
Notes
and
Suggestions
•
If
the
month or day is a number less
than
ten,
it
is not neces-
sary
to include a leading zero
(for
example, 09/09/84). When
MS-DOS stores and displays
the
date,
it
includes a leading
zero
in
a one-digit day and excludes
it
from a one-digit month
(for
example,
it
stores 9/09/1984).
•
You
can
separate
the
date,
month,
and
year
with
either
slashes, hyphens, or periods.
•
If
you omit the mm-dd-yyyy parameter,
DATE
displays
the
current
date and asks you to enter the new date.
If
you
do
not
want to change
the
date, press I
ENTER
I.
If
you
do
want to
change it, enter
it
in
the
mm-dd-yyyy format.
•
You
can change
the
date from the keyboard or from a batch
file. (Normally, MS-DOS displays a date prompt each time you
start
up your system.
It
does not, however,
if
you use
an
auto-
exec.bat
file. Therefore, you may want to include a
DATE
com-
mand in
that
file.)
• When you change
the
date known to
the
system, you also
change the date
in
any application program
you
use. This can
be very handy.
65