Tuesday, February 19, 2002 10:57 PM
You can directly substract two millis of date and figure out the number of days. For example,
Date date1 = ....
Date date2 = .....
long diff = date1.getTime() - date2.getTime();
int year = (diff + 86400 * 500) / 86400/ 1000;
Note that I have added 12 hours for rounding.