title: Finding number of days
body: <p>I have two time stamps in date format.</p>
  
  <p>How can I get the number of days that are present in the given range ? </p>
  
  <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("dd MM yyyy HH:mm:ss");
  Date begin=sdf.parse("27 02 2014 23:00:00");
  Date end=sdf.parse("01 03 2014 00:00:10");
  </code></pre>
  
  <p>In the above case it must be 3, that is (27th Feb , 28th Feb and 1st Jan)</p>
  
  <pre><code>int days = (int) (end.getTime() - begin.getTime())/(1000*3600*24) ;
  </code></pre>
  
  <p>The above method doesn't help as it considers the whole time stamp.</p>