SMT

Date Difference Calculator

Calculate the exact duration between two dates and times.

7d

0
Years
0
Months
7
Days (extra)
0
Hours
0
Minutes
0
Seconds

Total Duration In

Total Days
7
Total Hours
168
Total Minutes
10,080
Total Seconds
604,800
Business Days
5
Weekends
2

Weekday Breakdown

1
Mon
1
Tue
1
Wed
1
Thu
1
Fri
1
Sat
1
Sun

How Date Difference Is Calculated

Every date and time can be represented as a Unix timestamp — the number of seconds since January 1, 1970 UTC. To find the difference between two dates, the calculator subtracts the two timestamps and breaks the result into human-friendly units: years, months, weeks, days, hours, minutes, and seconds.

Exact vs. approximate units: Seconds, minutes, hours, and days are exact. Months and years are calendar-based — "3 months" means moving through the calendar by 3 month boundaries, which could be 89–92 days depending on which months are involved.

Business days: The calculator also counts business days (weekdays only) between the two dates, which is useful for project planning, SLA tracking, and legal deadlines.

Common Date Difference Calculations

Use CaseWhat You're Measuring
Age calculationTotal days, months, and years since a birthdate
Project timelineDays remaining until a deadline (with business day count)
Contract durationTotal length of an agreement in days or months
Billing cycleDays in a subscription period or billing window
Time since eventHow long ago a past date occurred
Days until holidayCalendar days between today and a future event
Lease durationTotal days covered by a rental or lease agreement

Frequently Asked Questions

How do I calculate days between two dates in code?

Convert both dates to Unix timestamps (seconds) and subtract. Then divide by 86400 for days. In JavaScript: Math.floor((new Date(d2) - new Date(d1)) / 86400000). In Python: (d2 - d1).days.

What is the difference between inclusive and exclusive day count?

Exclusive count (end - start) gives the number of full days between the dates. Inclusive count (end - start + 1) counts both the start and end day. For example, Jan 1 to Jan 3 exclusive = 2 days; inclusive = 3 days.

How many weeks is 90 days?

90 days ÷ 7 = 12 weeks and 6 days (approximately 12.86 weeks). Use the calculator with a 90-day span to see it broken down.

Does the calculator account for leap years?

Yes. The calculator works with the actual calendar, so February 29 in leap years is counted correctly when it falls within your date range.

What is the maximum date range I can calculate?

There is no practical limit. You can calculate the difference between dates thousands of years apart using this tool.