Date and Time Tools
Date Difference Calculator in Years, Months and Days
Calculate the interval between two dates in calendar years, months and days, elapsed full days, weeks, and converted time units, with CE and BE support.
Two dates, one clear interval
Choose the start and end dates
Adjacent dates are 1 day apart; equal dates are 0 days apart. Years can be entered as CE or BE.
Calendar interval
Difference between the dates
—
—
The totals measure elapsed date boundaries and do not count both endpoints inclusively.
Quick answer
How many years, months and days are between two dates?
Compare the earlier date with the later date, count completed calendar years and months, then the remaining days. Elapsed days measure the two date boundaries at 00:00, so adjacent dates are 1 day apart and equal dates are 0 days apart.
How to use this tool
- Choose the start and end dates; each can independently use Gregorian or Buddhist Era years.
- Calculate or edit the fields to update the calendar difference and elapsed time totals.
- Check the direction and counting convention before using a deadline, then export to Print, Excel, PDF, or TXT if needed.
How the calculation works
A Buddhist Era year is converted to Gregorian by subtracting 543 and every date is validated against real month lengths and Gregorian leap-year rules. The dates are ordered to calculate an absolute calendar difference while the interface retains whether the entered end date is before or after the start. Elapsed days run between 00:00 date boundaries in Asia/Bangkok and are converted to weeks, hours, minutes and seconds. Approximate months and years use 30.436875 and 365.2425 average days respectively.
Examples
| Example | Input | Expected result |
|---|---|---|
| Adjacent dates | |
0 years, 0 months, 1 day and 1 elapsed day |
| Across a leap year | |
1 year, 0 months, 0 days and 366 elapsed days |
| Reverse entry order | |
The end-before-start direction is shown and the absolute difference is 16 days |
Limitations
- This convention measures between date boundaries and does not count both endpoints; laws, contracts, or institutions can prescribe a different convention.
- The result is general calendar arithmetic, not certification of a legal, financial, medical, or eligibility deadline.
- Hours, minutes, and seconds are conversions of full days at 00:00 and exclude time-of-day or time-zone changes.
- Totals labeled approximate months or years are not counts of completed calendar months or years.
Frequently asked questions
Are both the start and end dates counted inclusively?
No. The calculator measures elapsed date boundaries, so equal dates are 0 days apart and adjacent dates are 1 day apart. If a rule requires both endpoints to be counted, adjust the result under that rule.
What happens if the end date is before the start date?
The calculator orders the dates and returns the absolute interval, but clearly identifies that the entered end date is before the start date to avoid a misleading interpretation.
Why are total months and total years approximate?
Calendar months and years do not all have equal lengths. Approximate totals divide elapsed days by 30.436875 days per month and 365.2425 days per year; the years-months-days result uses the actual calendar.
Are entered dates stored?
No. Calculation and file generation run in the browser, and the dates are not sent to the server.
References
- Microsoft Learn — DateTime.IsLeapYear Verified 2026-07-31
- IANA Time Zone Database — Asia/Bangkok Verified 2026-07-31
Content and calculation method last reviewed: