JSI Tip 10325. How can I determine the Year, Month, and Day date order and date separator?

I have scripted iDate.bat to return your date order registry entry and date separator.

iDate.bat retrieves your date order from the iDate Value Name, using REG.EXE, built into Windows XP and Windows Server 2003, or REG.EXE from the Windows 2000 Support Tools on the CD-ROM, which must be available in your PATH, and the date separator from the sDate Value Name.

The syntax for using iDate.bat is:

\[call\] iDate iDT iDS


iDT is a call directed environment variable that will contain:
Value Order
0 m/d/y
1 d/m/y
2 y/m/d
3 Unknown
iDS is a call directed environment variable that will contain the date separator. iDate.bat contains:
@echo off
If \{%2\}==\{\} @echo Syntax: iDate iDT iDS&goto :EOF
set df=3
for /f "Tokens=2,3" %%x in ('REG QUERY "HKCU\Control Panel\International" /V iDate^|find /i "REG_SZ"') do (
 set df=%%y
set ds=#
for /f "Tokens=2,3" %%x in ('REG QUERY "HKCU\Control Panel\International" /V sDate^|find /i "REG_SZ"') do (
 set ds=%%y
endlocal&set %1=%df%&set %2=%ds%

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.