Datetime · Calculator

Date Difference Calculator

Find the exact gap between two dates — in days, weeks, months, years, hours, minutes, seconds, and working days.

Select two dates
Quick presets

How to Use This Calculator

Pick two dates, get every number you need in one view.

1
Pick a Start Date
Click the start date field and select a date from the calendar picker, or type it directly in YYYY-MM-DD format. It defaults to today.
2
Pick an End Date
Select the end date in the same way. It can be before or after the start date — the calculator shows the absolute difference either way.
3
Use a Preset
Click any preset button to instantly fill both dates — Last 30 days, Year to date, This quarter, Today + 1 year, and more.
4
Read the Results
The big number shows total calendar days. Below that: the Y/M/D breakdown, then all other units — weeks, months, hours, minutes, workdays.
5
Swap the Dates
Click the ⇄ button between the inputs to flip start and end date. Useful when you want to reverse a date range without retyping.
6
Copy Any Value
Click any chip in the breakdown grid to copy its value. Individual rows also have a Copy button for the seconds total and other specific values.

What's Calculated

Every measurement this tool produces from your two dates.

📅
Calendar Days
Total days between the two dates including weekends and holidays — the raw gap from one midnight to the other.
🗓️
Y / M / D Breakdown
Full years, then full months, then remaining days — the natural way to express an age or duration. Accounts for varying month lengths.
💼
Workdays
Count of Monday–Friday days in the range. Perfect for project deadlines, SLA calculations, and payroll periods.
Hours, Minutes, Seconds
Total hours, minutes, and seconds in the interval — useful for time-based calculations and duration reporting.
📊
Timeline Bar
Visual representation of the date range to quickly understand the scale of the difference at a glance.
🔖
8 Presets
One-click presets for the most common ranges: last 30/90 days, year to date, this quarter, today ± 1 week/month/year.
🌸
Season, Day, Leap Year
See which day of the week both dates fall on, the season at the start date, and whether either year is a leap year.
🔒
100% Private
Everything runs in your browser. No dates are sent to any server — fully offline capable.

Frequently Asked Questions

The calculation subtracts the earlier date from the later date to get the total milliseconds, then divides by 86,400,000 (milliseconds in a day) and rounds to the nearest integer. Both dates are treated as midnight to avoid timezone shifts from affecting the count. The result is the total number of calendar days between the two dates.

Calendar days count every single day in the range — Mondays through Sundays, including public holidays. Working days (also called business days) count only Monday through Friday. This calculator counts Mon–Fri without subtracting public holidays, since those vary by country, region, and company. If you need to subtract specific holidays, take the working days result and subtract the number of holidays that fall within the range manually.

Dividing total days by 30 gives an approximation because not every month has 30 days. The Y/M/D breakdown uses calendar-accurate arithmetic: it counts full calendar years by comparing year numbers, then counts full calendar months accounting for the actual days in each month, then counts the remaining days. For example, from January 31 to March 2 is 1 month and 1 day — not 30 days — because February has fewer days and the month boundary falls earlier.

This calculator works on whole dates (midnight to midnight). The hours and minutes shown are derived from the day count (days × 24 and days × 1440), not from a specific time within each day. If you need the difference between two specific date-times — for example 2024-06-07 09:30 to 2024-06-08 15:45 — use the Unix Timestamp Converter's difference calculator, which accepts timestamps with time components.

Yes. By treating both dates as midnight at the start of the day (ignoring clock changes within a day), the calculation is unaffected by DST transitions. The total days count is always based on calendar days, not elapsed wall-clock hours. A day that "gains" or "loses" an hour due to DST still counts as one day.

A leap year has 366 days instead of 365, with February 29 added. The rule: a year is a leap year if it's divisible by 4, unless it's also divisible by 100 — but if it's divisible by 400, it is a leap year. So 2000 was a leap year, 1900 was not, 2024 was, 2100 will not be. The calculator includes the leap year status of both years in the results, and correctly counts February 29 as a day when the range spans it.

"Year to date" (YTD) sets the start date to January 1 of the current year and the end date to today. It tells you how many days have elapsed in the current calendar year so far — useful for financial reporting, progress tracking, and measuring how much of the year has passed.

Related Tools

View all →