Date calculator
Count the time between two dates, add or subtract from a date, or look up the weekday and week number.
Date arithmetic is trickier than it looks
Months have different lengths, years can be leap years, and weeks start on different days. This calculator follows the same rules as java.time, so its answers match what Period.between, ChronoUnit.DAYS.between and LocalDate.plus return in your code.
Clamped versus Period.between. The calendar-months result answers \"how many whole months fit, if a month is allowed to end early?\". Period.between(start, end) never lets a month end early: when the end day-of-month is smaller than the start day-of-month it takes one month off and counts the days from start.plusMonths(n). Both are shown so you can pick the one that matches your Java code. If the end date is before the start date, Period.between returns negative components.
All calculations use calendar dates (no clock time), so daylight-saving changes cannot add or remove a day.
Frequently asked questions
How are months and days counted?
Like Java's Period.between: whole months first (clamping to the end of a shorter month), then the leftover days. So 31 January to 1 March is 1 month and 1 day.
Does it count business days?
It counts Monday to Friday between the two dates (start included, end excluded). It does not know public holidays, which differ by country.
What happens when I add a month to 31 January?
The day is clamped to the last day of the target month, giving 28 February (29 in a leap year), the same as LocalDate.plusMonths.
What is an ISO week?
Weeks run Monday to Sunday and week 1 is the one containing the first Thursday of the year. Late December can belong to week 1 of the next year.