TIME (command)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
For the Unix command, see time (Unix).

In computing, TIME is a command in DOS, OS/2 and Windows that is used to display and set the current system time of the operating system. This command is available in command line interpreters (shells) such as COMMAND.COM, CMD.EXE, 4DOS, 4OS2 and 4NT.

In Unix, the date command displays and sets both the time and date, in a similar manner.

Syntax[edit]

The syntax differs depending on the specific platform and implementation:

DOS[edit]

TIME [time]

OS/2 (CMD.EXE)[edit]

TIME [hh-mm-ss] [/N]

Note: /N means no prompt for TIME.

Windows (CMD.EXE)[edit]

 TIME [/T | time]

When this command is called from the command line or a batch script, it will display the time and wait for the user to type a new time and press RETURN. The parameter '/T' will bypass asking the user to reset the time.

4DOS, 4OS2 and 4NT[edit]

TIME [/T] [hh[:mm[:ss]]] [AM | PM]

/T:  (display only)
hh:  The hour (0–23).
mm:  The minute (0–59).
ss:  The second (0–59), set to 0 if omitted.

Examples[edit]

OS/2 (CMD.EXE)[edit]

  • Display the current system time:
[C:\]TIME
Current time is:  3:25 PM
Enter the new time:

Windows (CMD.EXE)[edit]

  • To set the computer clock to 3:42 P.M., either of the following commands can be used:
C:\>TIME 15:42
C:\>TIME 3:42P

4DOS, 4OS2 and 4NT[edit]

  • Display the current system time:
C:\SYS\SHELL\4DOS>TIME /T
19:30:42

See also[edit]

References[edit]