After searching for a while about this topic i found 3 methods of Calendar class isBefore()
, isAfter()
And isAfter()
but this methods only returns true or false . So my question here is there a method or a way that allowed us to compare two dates and print how much they differ .
Example :
Calendar date1 = new GregorianCalendar(2020,12,01);
Calendar date1 = new GregorianCalendar(2020,12,20);
We should return 29 days .