Date Duration Calculator
The date duration calculator reports the span between two calendar dates in two complementary ways: a calendar breakdown into full years, months, and days, and an exact count of total days (plus total months and weeks). It is the tool for “how long is it from this date to that date” questions where a plain day count does not tell the whole story.
Use it for contract and notice terms, tenancy and lease periods, project timelines, subscription anniversaries, or any milestone where “2 years and 3 months” reads more naturally than “820 days.”
What this calculator does
Enter a start date and an end date. The primary result is the duration broken into years, months, and days. Supporting results show:
- Total days — the exact number of days between the two dates.
- Total months — the same span expressed as months (years × 12 plus months).
- Total weeks — full 7-day weeks within the total-day count.
The breakdown uses the Gregorian calendar, so month lengths vary (28 to 31 days) and February 29 exists in leap years. The day count includes every leap day that falls in the span.
How the calendar breakdown works
The breakdown counts in calendar units, not average units. First it takes the year difference, then the month difference, then the day difference, and it rebalances from the end: if the end day-of-month is smaller than the start day-of-month, it borrows one month back and adds the number of days in the month before the end date. If the month difference then goes negative, it borrows one year back and adds 12 months.
That is why a span from January 31 to February 28 is 0 years, 0 months, 28 days — the day count is real, but no full calendar month has passed. The total-day count is computed independently as the exact calendar difference between the two dates.
Formula
Let S be the start date and E the end date. Start with:
If days < 0, borrow from months:
If months < 0, borrow from years:
The exact day count is the calendar difference between the dates:
Worked example
Take the default span: January 15, 2020 to August 10, 2026.
The year difference is 6, the month difference is 8 − 1 = 7, and the day difference is 10 − 15 = −5. Because the day difference is negative, borrow one month:
so the breakdown is 6 years, 6 months, 26 days. Checking by addition: January 15, 2020 plus 6 years is January 15, 2026, plus 6 months is July 15, 2026, plus 26 days is August 10, 2026.
The exact day count: from January 15, 2020 to January 15, 2026 there are 2,192 days (2020 and 2024 are leap years), and from January 15 to August 10, 2026 there are 207 days:
In months and weeks:
Interpreting the result
The two readings answer different questions. “6 years, 6 months, 26 days” is the calendar reading: it matches how a birthday, a contract renewal, or a milestone anniversary is usually phrased. “2,399 days” is the exact reading: it is precise, comparable, and unaffected by which months the span crosses. Use the calendar reading for scheduling and the day count for anything that needs an exact number.
The same calendar date pair can produce slightly different breakdowns across tools because month-end conventions differ — some tools snap January 31 to February 28 as “1 month,” while the calendar-arithmetic convention used here reports the actual 28 days. The exact day count should always agree, and that is the number to trust for comparisons.
For a span anchored to a birth date, the age calculator gives the same years/months/days reading plus total months, weeks, and days since birth. To compare two people or two dates side by side, the age difference calculator reports the gap in the same units. If you already have a day count and need it in average months or weeks, the days to months calculator and the days to weeks calculator handle those conversions.
Tips
- Decide whether you need an inclusive count before quoting a term. A span from January 15 to January 20 is 5 days by exact difference, or 6 days if both endpoints are included.
- For end-of-month dates, state the convention you used. “End of January to end of February” is unambiguous as a phrase even though the calendar breakdown reads 0 years, 0 months, 28 days.
- Use the total-day count for anything contractual or comparative; it cannot be distorted by month-length differences.
Common pitfalls
- Expecting every month to count as 30 or 31 days; the breakdown is calendar-based, not average-based.
- Forgetting that the day count is exclusive of the end date, then being surprised that a same-day span reports 0 days.
- Assuming years are always 365 days; a span crossing a leap day includes February 29 in its total.
- Comparing breakdowns from tools with different month-end conventions without checking the underlying day count.
Sources
- ISO, ISO 8601-1:2019 — Date and time — Representations for information interchange — unambiguous YYYY-MM-DD date representation used by the inputs.
- Wikipedia, Gregorian calendar — month lengths and the leap-year rule behind the day counts.