title: Get first and last date of the previous month
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10828398/how-to-get-the-first-date-and-last-date-of-the-previous-month-java">How to get the first date and last date of the previous month? (Java)</a>  </p>
  </blockquote>
  
  
  
  <p>In java, how to get the first and last date of the previous month?</p>
  
  <p>If I am not wrong the following code is to get the last date of the previous month. </p>
  
  <pre><code>Calendar aCalendar = Calendar.getInstance();
  aCalendar.set(Calendar.DAY_OF_MONTH, -1);    
  aCalendar.add(Calendar.DAY_OF_MONTH, -1) ;
  System.out.println(new Timestamp(aCalendar.getTime().getTime()));
  </code></pre>
  
  <p>Correct me if I am wrong.</p>
  
  <p>Thank you.</p>