fortypoundhead.com

DATE

Posted On 2007-01-01 by FortyPoundHead
Keywords: Command Reference
Tags: Windows Commandline Windows
Views: 1533


Display or change the date

Syntax

to display the date

DATE /T

to set the system date

DATE

or

DATE

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 languageCountryCodeDate formatTime format
United States00101/23/19975:35:00.00p
Czechoslovakia04223.01.1997 17:35:00
France03323.01.1997 17:35:00
Germany04923.01.1997 17:35:00
Latin America00323/01/19975:35:00.00p
International English06123/01/1997 17:35:00.00
Portugal35123-01-1997 17:35:00
Finland35823.1.199717.35.00
Switzerland04123.01.97 17 35.00
Norway04723.01.97 17:35:00
Belgium03223/01/97 17:35:00
Brazil05523/01/97 17:35:00
Italy03923/01/97 17.35.00
United Kingdom04423/01/97 17:35:00.00
Denmark04523-01-97 17.35.00
Netherlands03123-01-97 17:35:00
Spain0343/12/9817:35:00
Hungary0361997.01.23 17:35:00
Canadian-French0021997-01-23 17:35:00
Poland0481997-01-23 17:35:00
Sweden0461997-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

Note: following command is all on one line:

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

Note: following command is all on one line:

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


About the Author

FortyPoundHead has posted a total of 1974 articles.

 


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:107.22.30.231

Before you can post, you need to prove you are human. If you log in, this test goes away.



Recent Forum Posts

List of Shady Characters
dwirch posted on April 25, 2017 at about 16:39 in Webmaster Stuff

Job Spammer: Bilal Uddin
dwirch posted on April 25, 2017 at about 11:00 in Spammers

Bug Fix: Contact Form Error
dwirch posted on April 21, 2017 at about 11:38 in Site News

Bug Fix: Ophion Time Tracker
dwirch posted on April 9, 2017 at about 11:30 in Site News

Job Spammer: Yogesh Kapadne
dwirch posted on March 31, 2017 at about 8:04 in Spammers

Job Spammer: Sathya Narayana
dwirch posted on March 15, 2017 at about 7:18 in Spammers