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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -