title: Get first date of current month in java
body: <p>I am trying to get to and from date where <code>ToDate</code> will have previous date and <code>FromDate</code> will have first date of the current month. For January it would be <code>1/1/2013</code> and so on. How to get the first date of the current month correctly? I am not able to do it.</p>
  
  <pre><code>today.add(Calendar.DAY_OF_MONTH, -1);
  java.util.Date previousDay=today.getTime();
  ToDate = sdfFile1.format(newjava.sql.Date(previousDay.getTime()));
  today.add(Calendar.DATE, 1);
  java.util.Date nextDay=today.getTime();
  FromDate = sdfFile1.format(new java.sql.Date(nextDay.getTime()));
  </code></pre>