title: Bug in Java Calendar / Date for 2nd October 2010?
body: <p>I'm not sure what I'm doing wrong, but I've got a piece of code which calculates the number of days between two dates, and which looks something like the following:</p>
  
  <pre><code>final Calendar first = new GregorianCalendar(2010, Calendar.OCTOBER, 1);
  final Calendar last = new GregorianCalendar(2010, Calendar.NOVEMBER, 1);
  
  final long difference = last.getTimeInMillis() - first.getTimeInMillis();
  final long days = difference / (1000 * 60 * 60 * 24);
  
  System.out.println("difference: " + difference);
  System.out.println("days: " + days);
  </code></pre>
  
  <p>To summarise, the code block above calculates the number of days between 1st October 2010 and 1 November 2010.  I'm expecting to see it return 31 days (seeing as there's 31 days in October) </p>
  
  <pre><code>difference: xxxx
  days: 31
  </code></pre>
  
  <p>but instead it's showing 30 days in October!</p>
  
  <pre><code>difference: 2674800000
  days: 30
  </code></pre>
  
  <p>I've managed to narrow it down to between the the dates 2 October 2010 and 3 October 2010, which seems to only have 82800000 milliseconds, instead of a full 86400000 milliseconds (exactly one hour missing).  </p>
  
  <p>Does anyone have any ideas what I'm doing wrong?  Or is the 2nd October a special date which has one minute less than a regular day?</p>