Closed afiller closed 10 months ago
This is correct. See https://docs.oracle.com/javase/8/docs/api/java/time/Period.html#between-java.time.LocalDate-java.time.LocalDate-.
A month is considered if the end day-of-month is greater than or equal to the start day-of-month.
This is how java.time.* works, thus ThreeTen-Extra follows
Ok, thank you for clarifying.
My JUnit tests failed today at the last day of August because of the following problem:
They calculated the amout of months between now (2023-08-31) and in 3 months (2023-11-30) and came to the result of 2, which is in my opinion wrong:
2023-08-31 --> add 3 months (also Java comes to this result) --> 2023-11-30
...but Threeten-Extra means it's only 2:
Output:
It MAY come from the change from summer to winter time, but this should not have an effect on the months calculation.
Any ideas?