Date Difference Calculator
Enter a start and end date to get the difference in years, months, weeks and days, plus the totals in each unit.
Calendar difference between two dates
This calculator breaks the gap between two dates into whole years, whole months, whole weeks and remaining days, the way people naturally describe an age or a countdown: for example 1 year, 3 months and 2 days rather than an unwieldy number of days. It also gives you the same gap as a single total in days, hours, minutes and seconds.
Leap years are handled automatically. A February that has 29 days is simply one day longer, so a difference that spans it comes out correctly without any extra input from you.
How the year and month count is chosen
Whole months are counted first, using the calendar (so January 31 to February 28 is treated as one full month), and any partial month left over is expressed in weeks and days. This matches how people read a date range on a calendar, rather than converting everything to an average month length.
Want the background? Read our comprehensive guide: Time Zones and DST for Developers.
How to use this tool
- Enter the start date, or select Use today.
- Enter the end date.
- Select Calculate difference.
- Read the breakdown in years, months, weeks and days, and the totals below it.
Examples
A leap-year crossing and a longer, multi-month gap.
Across a leap day
2024-02-28 to 2024-03-01
- Difference
- 2 days
- Total days
- 2
Nine and a half months
2026-09-01 to 2027-06-15
- Difference
- 9 months 2 weeks
- Total weeks
- 41
The same date, twice
2026-09-21 to 2026-09-21
- Difference
- 0 seconds
Frequently Asked Questions
How many days are between two dates?
Does it matter which date I enter first?
How are leap years handled?
Why do the years and months look different from just dividing the days?
Related tools
- Time Duration CalculatorElapsed time between two clock times, midnight crossings included.
- Add Time CalculatorAdd seconds, minutes, hours, days or weeks to a date and time.
- Subtract Time CalculatorSubtract seconds, minutes, hours, days or weeks from a date and time.
- Timestamp DifferenceFind the time between two timestamps as a duration.
- Date to TimestampConvert a date, time and time zone into a Unix timestamp.