TIME
Display or set the system time.
Syntax TIME [new_time]
TIME
TIME /T key new_time : The time as HH:MM TIME with no parameters will display the current time and prompt for a new value. Pressing ENTER will keep the same time. /T : Just display the time, formatted according to the current Regional settings.
Time Formatting
In Control Panel, Regional settings a Time Appearance can be set. This can be
used to change the separator, and the number of characters used to display hours
and minutes.
To display the time including Seconds:
ECHO.| TIME will display the time, including seconds and hundredths of a second
Time Format information in the Registry
The Country Code is a user setting in the registry:
[HKEY_CURRENT_USER\Control Panel\International]
"iCountry"="44"
The Country Code can be read using REG.exe as follows
FOR /F "TOKENS=2,3*" %%A IN ('REG QUERY "HKEY_CURRENT_USER\Control Panel\International\iCountry"') DO (FOR %%G in (%%A) DO (SET _country=%%G))
The time separator is also a registry setting
[HKEY_CURRENT_USER\Control Panel\International]
"sTime"=":"
The time separator can be read using REG.exe as follows
FOR /F "TOKENS=2,3*" %%A IN ('REG QUERY "HKEY_CURRENT_USER\Control Panel\International\sTime"') DO (FOR %%G in (%%A) DO (SET _time_sep=%%G))
The time formats for different country codes are as follows:
Country or language CountryCode Date format Time format United States 001 01/03/1994 5:35:00.00p Czechoslovakia 042 03.01.1994 17:35:00 France 033 03.01.1994 17:35:00 Germany 049 03.01.1994 17:35:00 Latin America 003 03/01/1994 5:35:00.00p International English 061 03/01/1994 17:35:00.00 Portugal 351 03-01-1994 17:35:00 Finland 358 3.1.1994 17.35.00 Switzerland 041 03.01.94 17 35.00 Norway 047 03.01.94 17:35:00 Belgium 032 03/01/94 17:35:00 Brazil 055 03/01/94 17:35:00 Italy 039 03/01/94 17.35.00 United Kingdom 044 03/01/94 17:35:00.00 Denmark 045 03-01-94 17.35.00 Netherlands 031 03-01-94 17:35:00 Spain 034 3/01/94 17:35:00 Hungary 036 1994.01.03 17:35:00 Canadian-French 002 1994-01-03 17:35:00 Poland 048 1994-01-03 17:35:00 Sweden 046 1994-01-03 17.35.00
If Command Extensions are disabled TIME
will not support the /T switch
"To me when a mother puts food in a microwave for her children, it is
an act of hate" - Raymond
Blanc
Related Commands:
DATE - Display or change the date
NOW - Display Message with Current Date and Time
TIMESERV - Time Service (resource kit)
W32TIME - Time Service (y2K compliant update for TIMESERV)
Timethis - Time how long it takes the system to run a command. (Win
2K ResKit)
Uptime - Time since last reboot. (Win 2K
ResKit)
GetTime.cmd - Script to get current time
GMT.cmd - Current time in GMT (World Time)
Equivalent Linux BASH commands:
date - Display or change the date &
time