title: Trying to Figure out MM/DD/YYYY vs DD/MM/YYYY
body: <p>I need to figure out if the current date 6/6/2013 is in MM/DD/YYYY vs DD/MM/YYYY format. Hence they are both "6".</p>
  
  <p>What I was going to do was take current date then add 3 days to it and from there I would know which one was the MM field because it wouldn't change. I don't know how to print the date+3 days in batch.  Is it even possible?  Does anyone have any ideas ?  I've been at it for a couple of hours.  I tried to use the GNU date command but I have to specify the output so it's not helpful.. GRR!</p>
  
  <p>Note, this is for WINDOWS. 
  Note, the file I'm looking at can't be changed so if the date is 9/9/2013, that is all I have to work with to determine the fields.</p>
  
  <p>EDIT:  I ended up using the following Code:
  It's a bit over done but you can see how I basically do it.  The reason why I'm setting the value is because I'm using it in conjunction with the Gnu date.exe command which is really good at provide date based on a particular day. So somewhere else in the script I use it like this:  date.exe --date "Now -90 days" %DATEFORMAT%. I had to ditch the date /T option suggested in another post because that doesn't actually show the correct data for all situations.</p>
  
  <pre><code>for /F "skip=1 tokens=3" %%a in ('reg query "HKCU\Control Panel\International" /v sShortDate ^&lt; NUL') do (
      echo.%%a|findstr /C:"/" &gt;nul 2&gt;&amp;1 &amp;&amp; set DELIM=/
      echo.%%a|findstr /C:"-" &gt;nul 2&gt;&amp;1 &amp;&amp; set DELIM=-
      echo.%%a|findstr /C:"." &gt;nul 2&gt;&amp;1 &amp;&amp; set DELIM=.
  
      for /F "tokens=1-3 delims=-/." %%b in ("%%a") do (
          set format=%%b%%c%%d
      )
  )
  
  if %DELIM%==/ ( 
      :: US English options 
      if %format%==Mdyyyy set DATEFORMAT=+%%-m/%%-d/%%Y 
      if %format%==Mdyy set DATEFORMAT=+%%-m/%%-d/%%y
      if %format%==MMddyy set DATEFORMAT=+%%m/%%d/%%y
      if %format%==MMddyyyy set DATEFORMAT=+%%m/%%d/%%Y
      if %format%==yyMMdd set DATEFORMAT=+%%y/%%m/%%d 
  
      :: UK English options
      if %format%==ddMMyyyy set DATEFORMAT=+%%d/%%m/%%Y
      if %format%==ddMMyy set DATEFORMAT=+%%d/%%m/%%y
      if %format%==dMyy set DATEFORMAT=+%%-d/%%-m/%%y
  
  ) else if %DELIM%==- (
      if %format%==yyyyMMdd set DATEFORMAT=+%%Y-%%m-%%d
      if %format%==ddMMMyy set DATEFORMAT=+%%d/%%m/%%y
      if %format%==dMyy set DATEFORMAT=+%%-d-%%-m-%%y
  ) else if %DELIM%==. (
      if %format%==dMyy set DATEFORMAT=+%%-d.%%-m.%%y
  ) else (
      echo ERROR: System was unable to identify dateformat.
      ping -n 10 -w 1 127.0.0.1 &gt;NUL
  )
  </code></pre>