Period period = new Period(startDate, endDate, PeriodType.yearMonthDay());
int years = period.getYears();
int months = period.getMonths();
int days = period.getDays();
if startDate = May 1, 1975 and endDate April 05, 2024
years = 48, months = 11, days = 4
but if startDate = April 30, 1975 and endDate April 05, 2024
years = 48, months = 11, days = 6
Why is the difference 2 days? expected days = 5! It just doesn’t look so logical when the user, choosing a birthday on the calendar, gets the age (from the current date) for May 1 - 4 days, and for April 30 - 6 days. This looks like an error.
joda time library is used
5/04/2024supposed to be04/05/2024?[jodatime]tag.java.time- if jsr310 (which comes from the same guy that wrote joda-time) does not exhibit this behaviour, that is itself quite interesting information. Write a trivial java class with amainthat hardcodes these timestamps of yours and prints the results.java.timebut seems to be similar problem