I need to find the number of days between two dates: one is from a report and one is the current date. My snippet:
int age=calculateDiffer
Hundred lines of code for this basic function???
Just a simple method:
protected static int calculateDayDifference(Date dateAfter, Date dateBefore){ return (int)(dateAfter.getTime()-dateBefore.getTime())/(1000 * 60 * 60 * 24); // MILLIS_IN_DAY = 1000 * 60 * 60 * 24; }