|
From: Don Yantzi
Improved in that it's 4 less lines of code :)
GregorianCalendar date1 = new GregorianCalendar(2008, 01, 15, 0, 0);
GregorianCalendar date2 = new GregorianCalendar(2008, 01, 21, 23, 59);
long diff = Math.abs(date2.getTimeInMillis() - date1.getTimeInMillis());
diff = diff / (1000 * 60 * 60 * 24);
System.out.println(diff);
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.