Name
time
Synopsis
Display or set the system time.
Syntax
time [/t | time]
Description
Like date (discussed earlier in this chapter),
time 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 time on the command line without an
option, the current time setting is displayed, and you are prompted
for a new one. Press Enter to keep the same date.
The time options are:
-
time Sets the system time without a prompt. The format of
timeishh:mm:ss[A|P], where:-
hh Hours: valid values = 0-23
-
mm Minutes: valid values = 0-59
-
ss Seconds: valid values = 0-59
-
A|P A.M. or P.M. (for a 12-hour format). If a valid 12-hour format is entered without an A or P, A is the default.
-
-
/t Displays the current time without prompting for a new one.
Notes
The time format depends on settings in Control Panel → Regional and Language Options.
Windows records the current time for each file you create or change. This time is listed next to the filename in the
dirdirectory listing.The time 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
timecommand.To have Windows automatically synchronize the clock with an Internet time server, go ...
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