title: Batch Script Timestamp Variable without spaces YYYY-MM-DD-HH-MM-SS
body: <p>I've created a timestamp variable in a batch script like so...</p>
  
  <pre><code>set TIMESTAMP=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%-%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%
  </code></pre>
  
  <p>There is an issue though when the HH is only a single digit I get...</p>
  
  <pre><code>YYYY-MM-DD- 2-MM-SS
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>YYYY-MM-DD-02-MM-SS
  </code></pre>
  
  <p>How do I consistently generate the timestamp without spaces?</p>