title: UNIX - Date format for yesterday
body: <p>I know there's some answers elsewhere on this site, and others, but can anyone help me get my date in format <strong>yyyymmdd</strong>, when I use anything I've found on different forums, I just get <strong>yyyymmd</strong>, my script then fails for the first 9 days of the month...</p>
  
  <p>The script I have at the moment uses bash and get the date using</p>
  
  <pre><code>date '+%m %d %Y'
  </code></pre>
  
  <p>However, this returns <strong>20120110</strong> for today, but for yesterday it returned <strong>2012019</strong>, I need this to return <strong>201201*<em>0</em>*9</strong>.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>
  
  <p>P.S. I can't install anything else onto this server, so gnu or perl are out.</p>