Name
date
Synopsis
Display or set the system date.
Syntax
date [/t | date]
Description
Date is essentially a holdover from the very early
days of DOS when the user was required to enter the system date and
time every time the computer was started. Now it’s
essentially included as a way to set the data from the command line;
the preferred method is to use Control Panel→ Date and Time.
If you type date on the command line without an
option, the current date setting is displayed and you are prompted
for a new one. Press Enter to keep the same date.
Date accepts the following options:
-
date Specifies the date. Use the mm-dd- [ yy ] yy format. Values for yy can be from 80 through 99; values for yyyy can be from 1980 through 2099. Separate month, day, and year with periods, hyphens, or slashes.
-
/t Displays the current date without prompting for a new one.
Notes
The date format depends on settings in Control Panel → Regional and Language Options.
Windows records the current date for each file you create or change. This date is listed next to the filename in the
dirdirectory listing.The date display format for most applications can be changed in Control Panel → Regional and Language Options → Regional Options tab → Customize, but this doesn’t affect the output of the DOS
datecommand.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access