Date Difference Calculator
Calculate the exact difference between two dates in years, months, days, weeks, hours, and business days.
Select two dates and click Calculate.
How Does the Formula Work?
The date difference calculator finds the exact duration between any two dates. It provides multiple representations of the same span: a human-readable breakdown in years, months, and days, the total number of days, weeks with remaining days, hours, minutes, seconds, and the count of business days (weekdays only). This is useful for project planning, age calculations, contract durations, countdown tracking, and many everyday questions like "how many days until my vacation?"
1. Ensure start ≤ end (auto-swap if reversed)
2. Total days = (end − start) in milliseconds ÷ 86,400,000
3. YMD breakdown: count full years, then full months, then remaining days
4. Weeks = total days ÷ 7, remainder = total days mod 7
5. Hours = total days × 24
6. Business days = count of Mon–Fri between start and end
Example: Jan 1, 2026 to May 7, 2026
= 4 months, 6 days = 126 total days
= 18 weeks, 0 days = 3,024 hours
= 90 business days, 36 weekend days
Year/Month/Day Breakdown
The YMD breakdown calculates complete calendar years first, then complete months, and finally the remaining days. This approach handles varying month lengths correctly — February has 28 or 29 days, while months like January and March have 31. For example, from January 31 to March 1 is 1 month and 1 day (not 29 or 30 days), because we count one full calendar month from January 31 to February 28/29, then the remaining day to March 1. Leap years are fully accounted for in all calculations.
Business Days Calculation
Business days count only weekdays — Monday through Friday. Weekends (Saturday and Sunday) are excluded from the count. This is particularly useful for project deadlines, shipping estimates, legal deadlines that specify "business days," and workplace scheduling. Note that this calculator does not exclude public holidays, as these vary by country and region. For precise business-day calculations that include holidays, you would need to specify which country's holiday calendar to use.
Practical Applications
Date calculations appear in many everyday situations. HR departments calculate employee tenure, notice periods, and probation lengths. Landlords determine lease durations. Parents count days until school starts or ends. Travelers plan how many days their trip lasts. Event planners calculate countdown timers. Legal professionals determine statute of limitations periods. Financial institutions calculate interest accrual periods. This tool handles all of these by providing the date span in every commonly needed unit.
Time Unit Conversions
The calculator derives larger units from total days: hours equals total days times 24, minutes equals hours times 60, and seconds equals minutes times 60. Weeks are calculated as total days divided by 7 with the remainder shown separately. These conversions assume standard 24-hour days and do not account for daylight saving time transitions, which can make individual days 23 or 25 hours long. For most practical purposes this level of precision is more than sufficient.
Tips & Recommendations
Enter dates in any order. The calculator automatically places the earlier date first and shows a positive difference.
The end date defaults to today. Change it to calculate any span — past or future, birthdays, deadlines, or countdowns.
Business days count Mon–Fri only. Public holidays are not excluded as they vary by country. Good for project planning.
February 29 is correctly handled. A year spanning a leap year will show 366 days instead of 365.
Frequently Asked Questions
How is the year/month/day breakdown calculated?
Each component is calculated separately: full years first, then full months, then remaining days. This accounts for varying month lengths and leap years.
What are business days?
Business days are weekdays — Monday through Friday. Weekends (Saturday and Sunday) are excluded. Public holidays are not excluded as they vary by country.
Does it handle leap years?
Yes. February 29 is correctly accounted for in leap years. A span from Jan 1, 2024 to Jan 1, 2025 shows 366 days because 2024 is a leap year.
What if I enter the dates in reverse order?
The calculator automatically swaps the dates so the earlier date comes first. The result is always a positive difference.
What is the maximum date range?
There is no practical limit. You can calculate differences spanning centuries.
Recent Calculations
No calculations yet