# Difference in command line date format between XP & Windows 7

The DATE command in XP gives the date in the format ddd dd/mm/yyyy e.g. Sun 12/12/2010. In Windows 7, it only gives dd/mm/yy I.e. 12/12/2010.
Both have the same regional settings.
Can Windows 7 be forced to display the date in the same way as XP, or can the day be extracted in the ddd format?

-
I've just tried date on my XP and it output it as 11/12/2010 (UK) format and then prompted me for the new date. date /t just outputs the current date (again without the day). – ChrisF Dec 11 '10 at 23:24
WIn 7 gives me XP-style i.imgur.com/EJwbS.png – Sathya Dec 11 '10 at 23:26
You probably have different locale settings on the two OSes. IIRC they're called “Regional settings” in the Control Panel in Windows XP. – Gilles Dec 12 '10 at 0:39
You are correct - that happens with UK regional settings. I am using Australian settings in both XP & Win7 & they produce different results. – PC112 Dec 12 '10 at 2:03
I have just found a solution by changing the "Short Date" format to a customised one: "ddd dd/mm/yyyy". This gives the same result at the command line as XP with standard Australian settings. I just have to test what other impacts it will have. – PC112 Dec 12 '10 at 2:18

This is controlled by the "Short Date" setting under Control Panel → Region and Language → Format tab → Additional Settings → Date tab

Observe the results of date /t with short date set to "M/d/yyyy", then to "MM/dd/yyyy":

-
As I said in my previous post - changing the regional settings did provide the correct result for the Command Line format, but it also changed the format in many other systems which made it unacceptable. So it is back to square one. I either have to find a solution that enables me to provide the same format for Date in Win7 as it did in XP (Australian settings), otherwise I have to rewrite a whole lot of batch files. Anyone have any suggestions???? – PC112 Dec 13 '10 at 12:41
Thanks for this one. I'm using English(Australia) on Windows Server 2003 and had the same problem with two users with apparently the same regional settings. Even the example short date format had both as 7/11/2011. Only be going into the customize option did I find d/MM/yyyy and dd/MM/yyyy. – Richard A Nov 7 '11 at 3:38

Found from this Stack Overflow answer, UnxUtils contains a date.exe which can take a specified format parameter.

date.exe +"%a %m/%d/%Y"
Mon 12/13/2010


UnxUtils contains a lot of other files, but I just confirmed you can just take date.exe and run it independently of everything else.

Note that you need to call it as date.exe or path\to\date and not just date, because otherwise the built-in shell command will run instead. Or, you can rename it to something like DateFormat.exe.

-

I have tested the date.exe app from UnxUtils & it has worked successfully so far in my test environment. I am about to implement it in one of my smaller client's environment & if that is successful, I will roll it out on all my clients sites. Thanks for the pointer to UnxUtils.

-