title: Get yesterday's date using Date
body: <p>The following function produces today's date; how can I make it produce only yesterday's date?</p>
  
  <pre><code>private String toDate() {
          DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
          Date date = new Date();    
          return dateFormat.format(date).toString();
  }
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>2012-07-10
  </code></pre>
  
  <p>I only need yesterday's date like below. Is it possible to do this in my function?</p>
  
  <pre><code>2012-07-09
  </code></pre>