title: How to calculate 30 days back from today using Calendar in Java
body: <p>I want to calculate the date 30 days back from today's date.</p>
  
  <pre><code>public void dateSetup(){
          DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd ");
          Calendar cal = Calendar.getInstance();
          Calendar calReturn = Calendar.getInstance();
          jDate_timeOfExpectedReturn1.setText(dateFormat.format(cal.getTime()));
          calReturn.add(Calendar.DATE, 30);
          jDate_timeOfLoan1.setText(dateFormat.format(calReturn.getTime()));
      }
  </code></pre>
  
  <p>Above you can see that I'm extracting today date using <code>Calendar cal = Calendar.getInstance();</code></p>
  
  <p>How do I calculate the date of 30 days before the extracted date?</p>
  
  <p>Thanks for any help given.</p>