-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
8u71
-
generic
-
generic
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
When try to find the number of months between 31/12/2015 and 29/02/2016 it returns 1 instead of 2.
But when we add 2 months to 31/12/2015 it returns 29/02/2016.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
LocalDate date1 = LocalDate.of(2015, Month.DECEMBER, 31);
LocalDate date2 = date1.plusMonths(2);
System.out.println(date2);
System.out.println(ChronoUnit.MONTHS.between(date1, date2));
System.out.println(Period.between(date1, date2));
---------- END SOURCE ----------
A DESCRIPTION OF THE PROBLEM :
When try to find the number of months between 31/12/2015 and 29/02/2016 it returns 1 instead of 2.
But when we add 2 months to 31/12/2015 it returns 29/02/2016.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
LocalDate date1 = LocalDate.of(2015, Month.DECEMBER, 31);
LocalDate date2 = date1.plusMonths(2);
System.out.println(date2);
System.out.println(ChronoUnit.MONTHS.between(date1, date2));
System.out.println(Period.between(date1, date2));
---------- END SOURCE ----------