title: Java, get days between two dates
body: <p>In java, I want to get the number of days between two dates, excluding those two dates.</p>
  
  <p>For example:</p>
  
  <p>If first date = <code>11 November 2011</code> and the second date = <code>13 November 2011</code>
  then it should be <code>1</code>.</p>
  
  <p>This is the code I am using but doesn't work (<code>secondDate</code> and <code>firstDate</code> are <code>Calendar</code> objects):</p>
  
  <pre><code>long diff=secondDate.getTimeInMillis()-firstDate.getTimeInMillis();
  float day_count=(float)diff / (24 * 60 * 60 * 1000);
  daysCount.setText((int)day_count+"");                    
  </code></pre>
  
  <p>I even tried rounding the results but that didn't help.</p>
  
  <p>How do I get the number of days between dates in java excluding the days themselves?</p>