Date Duration Calculator: How It Works
Counting the days between two dates is harder than it looks, because months have different lengths, leap years exist, and there are two defensible answers to whether the endpoints count. This calculator handles all three.
Inclusive or exclusive
From 1 March to 5 March is either 4 days or 5, depending on what you are counting.
| Count | Answer | Right for |
|---|---|---|
| Exclusive (difference) | 4 | Elapsed time, interest calculation, age |
| Inclusive (both ends) | 5 | Hotel nights, leave requests, event durations |
Neither is more correct; they answer different questions. Contracts and payroll rules usually specify which applies, and the difference of one day matters when it decides a deadline or a day's pay. When writing a rule, say 'inclusive of both dates' explicitly.
Working days
Excluding weekends is straightforward arithmetic; excluding holidays is not, because holiday calendars are national, regional and sometimes religious, and they change year to year. Some move with the lunar or ecclesiastical calendar; some are observed on the following Monday when they fall at a weekend.
A calculator can subtract weekends reliably. For a contractual deadline, check the actual holiday calendar of the relevant jurisdiction — 'ten working days' means different dates in different countries, and legal deadlines are unforgiving about it.
Leap years
A year is a leap year if divisible by 4, except centuries, unless divisible by 400. So 1900 was not and 2000 was. Any correct date arithmetic handles this automatically; the rule matters when you are checking a result by hand and wondering whether a February is 28 or 29 days.
Months are not a fixed length
'Three months from 31 January' has no unambiguous answer. Implementations differ: some give 30 April by clamping to the month end, others give 1 May by overflowing. This is why a duration expressed in months and days can differ between tools while the total days elapsed agrees exactly.
For anything where precision matters — interest accrual, notice periods, contractual deadlines — count in days. Months are a human convenience, not a unit.
Time zones and daylight saving
The number of days between two dates is unaffected by time zones, but the number of hours is not. A day containing a daylight saving transition is 23 or 25 hours long. If you need an exact duration in hours across such a boundary, calculate from timestamps rather than multiplying days by 24.
What people use this for
- Contract and notice periods — where the inclusive/exclusive question is decided by the wording.
- Project planning — working days between milestones.
- Leave calculation — usually inclusive of both first and last day.
- Interest and penalties — usually exclusive, and often on a 360-day convention in commercial contracts rather than 365.
- Visa and residency limits — commonly counted as days present, inclusive, within a rolling window.
That last case is worth flagging: rolling-window rules such as '90 days in any 180' require counting backwards from each date, not simply summing stays. Getting it wrong has real consequences, so check against the official guidance rather than a general calculator.