Date Difference Calculator
Calculate the exact duration between two dates and times.
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 Case | What You're Measuring |
|---|---|
| Age calculation | Total days, months, and years since a birthdate |
| Project timeline | Days remaining until a deadline (with business day count) |
| Contract duration | Total length of an agreement in days or months |
| Billing cycle | Days in a subscription period or billing window |
| Time since event | How long ago a past date occurred |
| Days until holiday | Calendar days between today and a future event |
| Lease duration | Total 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.