title: Java dates difference in milliseconds
body: <p>I've written the following code, but I always just get...</p>
  
  <p>4838399999
  Seconds is : 59
  Minutes is : 59
  Hours is : 23
  Days is : 7</p>
  
  <pre><code>Calendar xmas = Calendar.getInstance();
  final Calendar now = Calendar.getInstance();
  
  xmas.set(Calendar.YEAR, 2011);
  xmas.set(Calendar.MONTH, Calendar.DECEMBER);
  xmas.set(Calendar.DAY_OF_MONTH, 25);
  
  long milliseconds1 = now.getTimeInMillis();
  long milliseconds2 = xmas.getTimeInMillis();
  long diff = milliseconds2 - milliseconds1;
  System.out.println(diff);
  diff = diff / 1000;
  
  final long diffSeconds = diff % 60;
  System.out.println("Seconds is : " + diffSeconds);
  diff = diff / 60;
  
  final long diffMinutes = diff % 60;
  System.out.println("Minutes is : " + diffMinutes);
  diff = diff / 60;
  
  final long diffHours = diff % 60;
  System.out.println("Hours is : " + diffHours);
  diff = diff / 24;
  
  final long diffDays = diff % 24;
  System.out.println("Days is : " + diffDays);
  </code></pre>
  
  <p>Can anyone see anything wrong with this logic to find the days, hours, minutes and seconds till xmas?  </p>