title: Getting yesterday - The method getDate() from the type Date is deprecated
body: <p>I try to get the date of yesterday. So I write the next function:</p>
  
  <pre><code>public  String getYestrday() {
      DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
      Date date = new Date();
      return dateFormat.format(date.getDate() - 1);
  }
  </code></pre>
  
  <p>But it gives me the next warning:</p>
  
  <pre><code>The method getDate() from the type Date is deprecated
  </code></pre>
  
  <p>and it doesn't do it work.</p>
  
  <p>Thank you for your help.</p>