java - How to check if there is at least 1 day difference between 2 dates -
so, have check if difference between 2 dates @ least 1 day. method should return true, otherwise false.
the format dates i´m using gregoriancalendar(year, month, day)
.
so have method uses date1.before(date2)
, checks time, ifdate1
before date2
returns true, if same day (but time different!).
what need way check if difference between dates @ least 1 day.
any ideas?
add 1 day cal1 , test if it's not after cal2
cal1.add(calendar.date, 1); system.out.println(!cal1.after(cal2));
Comments
Post a Comment