A DESCRIPTION OF THE PROBLEM :
The example included in the documentation of method minusMonths of class LocalDateTime adds a month instead of subtracting it.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Access https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#minusMonths-long-
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead."
ACTUAL -
"For example, 2007-03-31 minus one month would result in the invalid date 2007-04-31. Instead of returning an invalid result, the last valid day of the month, 2007-04-30, is selected instead."
The example included in the documentation of method minusMonths of class LocalDateTime adds a month instead of subtracting it.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Access https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#minusMonths-long-
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead."
ACTUAL -
"For example, 2007-03-31 minus one month would result in the invalid date 2007-04-31. Instead of returning an invalid result, the last valid day of the month, 2007-04-30, is selected instead."
- duplicates
-
JDK-8160036 Java API doc for method minusMonths in LocalDateTime class needs correction
- Closed