The following code will give you the difference between two dates:
import java.util.Date; import java.util.GregorianCalendar; public class DateDiff { public static void main(String[] av) { Date d1 = new GregorianCalendar(2000, 11, 31, 23, 59).getTime(); Date today = new Date();
source share