Date Difference Calculator
Calculate the difference between two dates. Calendar breakdown, totals, and business days.
Calculate the difference between two dates in years, months, days, weeks, hours, and business days. Handles leap years and timezones. Runs in your browser. Read more Show less
What is a date difference?
Between two dates there are two answers, and they are not the same number. The first is the calendar difference: "1 year, 3 months, 12 days". The second is the elapsed time: "465 days". Both are correct; they answer different questions.
You want the calendar difference when describing a duration in human terms - age, tenure, contract length. You want the elapsed total when doing arithmetic - billing days, timestamps, scheduling.
How to use
Set the start and end date. Times are optional - if you leave them blank, the tool treats each date as midnight. The result appears below, updated live.
Two checkboxes change how day counts work:
- Include end date - adds one day to the total and business-day counts. Use this when both endpoints are meaningful, as in "how many working days is this project" where the last day counts.
- Count weekends as business days - by default, business days skip Saturday and Sunday. Enable this to count every calendar day.
Calendar vs total
Take 2024-01-31 to 2024-03-01. The calendar difference is "1 month, 1 day" - one full month (from Jan 31 to Feb 29, since 2024 is a leap year, clamped to the end of February) plus one day. The total is 30 days.
Both are 30 days of elapsed time, but "1 month, 1 day" is what a human would say. Neither answer is more correct; they are different views of the same interval.
A note on timezones
Dates are parsed in your local timezone. A date like 2024-01-15 means January 15 in the location where the page is running, not midnight UTC. This is intentional: if you enter your birthday, you want to see your birthday, not the day before because of a UTC offset.
The same date entered on two machines in different timezones may therefore produce slightly different results when times are included. For pure date-to-date calculations with no time, the difference is unaffected.
FAQ
Why is my result off by one day?
Because the end date is not included by default. From January 1 to January 5 is 4 days, not 5. If you want the end date to count, enable "Include end date".
What happens if the end is before the start?
The tool computes the absolute difference and shows it as a positive number. Calendar differences display with a leading minus sign. The magnitude is the same either way.
Does it handle leap years?
Yes. JavaScript date arithmetic handles leap years correctly. February 29 is a valid date in leap years, and the day count reflects it.
What about Daylight Saving Time?
Day counts use local calendar days, so a Spring Forward (23-hour day) or Fall Back (25-hour day) does not change the count. If you need exact elapsed seconds across a DST boundary, use the total seconds field, which reflects the real duration.
Is my data sent anywhere?
No. All arithmetic runs in your browser.
Command line equivalent
# GNU date
# Days between two dates
echo $(( ($(date -d '2025-04-27' +%s) - $(date -d '2024-01-15' +%s)) / 86400 ))
# Busy days only (Mon-Fri), using python
python3 -c "from datetime import date; import numpy as np; d1=date(2024,1,15); d2=date(2025,4,27); print(np.busday_count(d1, d2))"
# Python (dateutil, calendar months and days)
pip install python-dateutil
python3 -c "from dateutil.relativedelta import relativedelta; from datetime import date; print(relativedelta(date(2025,4,27), date(2024,1,15)))"
# Node (date-fns)
npm i date-fns
node -e "const {differenceInCalendarDays,intervalToDuration}=require('date-fns'); const a=new Date('2024-01-15'), b=new Date('2025-04-27'); console.log(differenceInCalendarDays(b,a)+' days'); console.log(intervalToDuration({start:a,end:b}))"