title: Batch: How to export yesterday's date keeping format [mm/dd/yyyy]?
body: <p>I am trying to create an environment variable for yesterday's date. It MUST be in the format of <strong>MM/DD/YYYY</strong>.</p>
  
  <p>For code I currently have:</p>
  
  <pre><code> set m=%date:~-7,2%
   set /A m -= 1
   set DATE_YESTERDAY=%date:~-10,2%/%m%/%date:~-4,4%
   echo %DATE_YESTERDAY%
  </code></pre>
  
  <p>This works great, HOWEVER, when I offset to yesterdays day with -1 instead of "<strong>12/03/2019</strong>" I get "<strong>12/3/2019</strong>".  Thus, missing the zero/0.</p>
  
  <p>Any ideas to keep format as <strong>MM/DD/YYYY</strong>?</p>
  
  <p>I have seen many other questions regarding this, however, all come short!</p>
  
  <p>NOTE - I do NOT want powershell or VBS scripts.  I know this can be done with simply batch.</p>