title: Code is fetching current date instead of previous date in batch script
body: <p>I have a batch file which has the following content:</p>
  
  <pre><code>set m=%date:~-7,2%
  set /A m -= 1
  set DATE_DIR=%date:~-10,2%-%m%-%date:~-4,4%
  
  echo 'DATE_DIR'
  ![enter image description here][1]
  :: First delete all snapshots from this day last week
  :: Create a file with all scheduled snapshots
  ec2-describe-snapshots|find /i "%DATE_DIR%: Daily Backup for"
  </code></pre>
  
  <p>I have set the DATE_DIR parameter to yesterday's Date, so the ec2-describe statement should fetch the snapshots that are created on yesterday, but it is fetching data of present day!!</p>
  
  <p>Any lead is appreciated.</p>
  
  <p>Thanks</p>