------------------------- MS-DOS v6.22 Help: TIME --------------------------
<Notes> <Examples>                                               <Index>


Displays the system time or sets your computer's internal clock.

MS-DOS uses time information to update the directory whenever you create or
change a file.


    TIME [hours:[minutes[:seconds[.hundredths]]][A|P]]

To display the current time or to display a prompt by which you can change
the current time, use the following syntax:



    Specifies the hour. Valid values are in the range 0 through 23.

    Specifies minutes. Valid values are in the range 0 through 59.

    Specifies seconds. Valid values are in the range 0 through 59.

    Specifies hundredths of a second. Valid values are in the range 0
    through 99.

    Specifies A.M or P.M. for the 12-hour time format. If you type a valid
    12-hour time but do not type A or P, TIME uses A (for A.M.).

Related Commands

For information about changing the current date, see the <DATE> command.

For information about changing the time format, see the <COUNTRY> command.


<Syntax> <Examples>


Specifying an invalid TIME format

If you specify the time in an invalid format, MS-DOS displays the following
message and then waits for you to specify the time:

    Invalid time
    Enter new time:_

Changing the TIME format

You can change the TIME format by changing the COUNTRY setting in your
CONFIG.SYS file. For more information, see the <COUNTRY> command. Depending
on the country code, MS-DOS will display the time in the 12-hour format or
the 24-hour format. If you are setting the time in the 12-hour format, be
sure to specify P for hours after noon.

Ensuring that MS-DOS prompts you for the time

If you want MS-DOS to prompt you for the current time whenever you start
your system, you can add the TIME command to your AUTOEXEC.BAT file. MS-DOS
will automatically prompt you for the time and date if you do not have an

<Syntax> <Notes>


To set your computer's clock to 1:36 P.M., use either of the following

    TIME 13:36

    TIME 1:36p


<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005