Date Difference Calculator
Count the days between two dates and get the exact difference in years, months, weeks, days, hours and business days. Switch to Add / subtract to find the date N days, weeks, months or business days from any date. Everything runs in your browser — nothing is uploaded.
Paste dates as YYYY-MM-DD, separated by commas, spaces or new lines. Holidays on weekends are ignored.
For developers: milliseconds, timestamps & code
Pick two valid dates above to see timestamps and code snippets.
How the date difference is calculated
- Total days is the number of midnights between the two dates (the end date is excluded). Turn on Include end date to count both the first and last day — e.g. Mar 1 → Mar 31 is 30 days, or 31 days inclusive.
- Years, months and days are counted on the calendar: whole months are added from the start date first, then the leftover days. If the start day doesn't exist in a month it is clamped to the last day, so Jan 31 → Feb 29, 2024 is 29 days and Jan 31 → Mar 1 is 1 month, 1 day.
- Business days counts Monday–Friday in the same range and subtracts any pasted holidays that fall on a weekday. Monday → next Monday is 5 business days (6 with the end date included).
- Past ranges: if the end date is before the start date, every value is shown as negative instead of throwing an error.
Why DST doesn't break the day count
In timezones with daylight saving time, one day per year is 23 hours long and another is 25 hours. Code that divides local elapsed milliseconds by 86,400,000 gets numbers like 89.958 instead of 90 and can be off by one after rounding down. This calculator does all calendar-day math on UTC dates, where every day is exactly 24 hours, so the count is always a whole number. When a range crosses a DST change in your timezone, the developer section above shows the real elapsed milliseconds separately.
Common day counts
| Period | Days | Business days (approx.) |
|---|---|---|
| 1 week | 7 | 5 |
| 1 month | 28–31 | 20–23 |
| 1 quarter (3 months) | 90–92 | ~65 |
| 1 year | 365 (366 in a leap year) | 260–262 |
Working with raw timestamps instead? Use the Epoch Converter, compare clocks across cities with the Timezone Comparison tool, or browse all date & time tools.