title: java - Start Date of Last Month
body: <p>I want to calculate the start date of the last month. I have referred <a href="https://stackoverflow.com/questions/3083781/start-and-end-date-of-a-current-month">this post</a> and I have written the snippet as follows:</p>
  
  <pre><code>Calendar calendar = getCalendar(new Date());
  calendar.set(Calendar.DAY_OF_MONTH-1,
          calendar.getActualMinimum(DAY_OF_MONTH));
  calendar = getTimeToBeginningOfDay(calendar);
  
  return calendar.getTime();
  </code></pre>
  
  <p>With this <strong>I'm able to get the Date before the end of the last month</strong>. Help me get the start date of Any help would be appreciated.</p>