title: Comparing a modified file date with the current date in a batch file
body: <p>I'm required to write a batch file to do a few things</p>
  
  <p>Initially I thought my problem was very simple - capture the modified date of a txt file located in a specified directory, compare that date to the current date and if they are the same do something. If they are not then do something else.</p>
  
  <p>The line I use to capture the current date is: </p>
  
  <pre><code>%date%
  </code></pre>
  
  <p>The lines I use to capture the modified date of my specified file is: </p>
  
  <pre><code>SET filename="C:\New Folder\New.txt"
  FOR %%f IN (%filename%) DO SET filedatetime=%%~tf
  ECHO %filedatetime:~0,-6% &gt;&gt; %destination%
  </code></pre>
  
  <p>In the above case I'm simply using <code>echo</code> to see what is returned and it seems as if the date is returned but I get extra information:</p>
  
  <blockquote>
    <p>2012/02/19 02</p>
  </blockquote>
  
  <p>I would like to know how to get the above values where they are comparable as well as how to compare them properly.</p>