title: How can I get yesterday's date without using Calendar in Java and without a timestamp just the date?
body: <p>I have wrote a method to get the current date in the format of <code>yyyy-MM-dd</code> and want to be able to also create another method for getting yesterday's date, the day before the current date.  All this needs is the date and not the timestamp.  I am not trying to use <code>Calendar</code> as well. I have set up the current date this way:</p>
  
  <pre><code>public class DateWithNoTimestamp
  {
         private static final String CURRENT_DATE_FORMAT = "yyyy-MM-dd";
  
         public final static String getCurrentDate()
         {
                 DateFormat dateFormat = new SimpleDateFormat(CURRENT_DATE_FORMAT);
                 Date date = new Date();
                 return dateFormat.format(date);
         } 
  }
  </code></pre>
  
  <p>This works to get the current date, now the separate method <code>getYesertdayDate()</code> I'm having trouble with.  How can I set it up in a similar way as I did with <code>getCurrentDate()</code> while subtracting one day ? </p>