public long compareDates(Date exp, Date today){
long b = (exp.getTime()-86400000)/86400000;
long c = (today.getTime()-86400000)/86400000;
return b-c;
}
This works for GregorianDates.
86400000 are the amount of milliseconds in a day, this will return the number of days between the two dates.