title: cmd line rename file with date and time
body: <p>Project moving forwards, I can see why creating .bat files to do things can become addictive!
  I can now save somefile.txt at regular intervals, I then rename somefile.txt by adding the time and date to create a unique file name</p>
  
  <pre><code>ren somefile.txt somefile_%time:~0,2%%time:~3,2%-%date:~-10,2%%date:~3,2%%date:~-4,4%.txt
  </code></pre>
  
  <p>As an example, the code above has just renamed <code>somefile.txt</code> to <code>somefile_1317_13022011.txt (1317hrs on 13th February 2011)</code></p>
  
  <p>I ran</p>
  
  <pre><code>ren somefile.txt somefile_%time:~0,2%%time:~3,2%-%date:~-10,2%%date:~7,2%%date:~-4,4%.txt 
  </code></pre>
  
  <p>yesterday, it ran successfully until midnight, and then it crashed (syntax error) although it was saving as 12012011 for the date (12th Jan 2011) instead of the correct date of 12022011.</p>
  
  <p>Will the current version ran past midnight? Am I confusing myself with UK vs US date format?</p>