code: private int compareDate(Date a, Date b) {
  		final Date ta = new Date(a.getTime());
  		final Date tb = new Date(b.getTime());
  		final long d1 = setHourToZero(ta).getTime();
  		final long d2 = setHourToZero(tb).getTime();
  		return (int) Math.round((d2 - d1) / 1000.0 / 60.0 / 60.0 / 24.0);
  	}
docs: Calculate the number of days between two dates
  
  @param a Date
  @param b Date
  @return the difference in days between b and a (b - a)