Home NT Commands
NT Syntax

DATE

Display or change the date

syntax

to display the date   
      DATE /T

to set the system date
      DATE
or
      DATE <date_today>

A typical output from DATE /T is "Mon 11/09/2000" but this is dependent on the country code.
The date formats for different country codes are as follows:

   Country or language   CountryCode  Date format Time format

United States 001 01/23/1997 5:35:00.00p
Czechoslovakia 042 23.01.1997 17:35:00 France 033 23.01.1997 17:35:00
Germany 049 23.01.1997 17:35:00
Latin America 003 23/01/1997 5:35:00.00p International English 061 23/01/1997 17:35:00.00
Portugal 351 23-01-1997 17:35:00
Finland 358 23.1.1997 17.35.00

Switzerland 041 23.01.97 17 35.00 Norway 047 23.01.97 17:35:00
Belgium 032 23/01/97 17:35:00 Brazil 055 23/01/97 17:35:00
Italy 039 23/01/97 17.35.00 United Kingdom 044 23/01/97 17:35:00.00

Denmark 045 23-01-97 17.35.00
Netherlands 031 23-01-97 17:35:00
Spain 034 3/12/98 17:35:00
Hungary 036 1997.01.23 17:35:00
Canadian-French 002 1997-01-23 17:35:00 Poland 048 1997-01-23 17:35:00
Sweden 046 1997-01-23 17.35.00

Date Formatting

In Control Panel Regional settings a short date STYLE can be set. This can be used to change the date separator, the order (e.g. dd/mm/yyyy or mm/dd/yyyy) and the number of characters used to display days and months.

Date Format information in the registry

The Country Code is a setting in the registry:

This can be read using REG.exe as follows

FOR /F "TOKENS=3 delims=	" %%G IN ('REG QUERY "HKEY_CURRENT_USER\Control Panel\International\iCountry"') DO (SET v_country=%%G)

The date separator is also a registry setting

This can be read using REG.exe as follows

FOR /F "TOKENS=3 delims=	" %%G IN ('REG QUERY "HKEY_CURRENT_USER\Control Panel\International\sDate"') DO SET v_date_sep=%%G

If Command Extensions are disabled DATE will not support the /T switch

"Carpe Diem - Seize the day" - Horace

Related Commands:


NOW - Display Message with Current Date and Time
NET TIME - Display the Date in US Format (mm-dd-yy)
REG - Read, Set or Delete registry keys and values
TIME - Display or set the system time
TOUCH - Change file timestamps

Equivalent Linux BASH commands:

cal - Display a calendar
date - Display or change the date
time - Measure Program Resource Use
times - User and system times
touch - Change file timestamps



Simon Sheppard
SS64.com