Date Duration Calculator

This professional date duration calculator computes the exact difference between two dates (and optional times). It is designed for planners, HR teams, project managers, legal professionals, researchers, and anyone who needs a precise, explainable breakdown across calendar years, months, days, weeks, total days, and business days, with options to exclude weekends and custom holidays.

Interactive Calculator

Options

Listed days are removed from business day totals.

Configure time inclusion, inclusive end date, weekend exclusions, and optional holidays.

Results

Enter valid dates to see the duration summary.

Calendar span (Y M D)
Weeks + days
Total days
Business days
Total hours
Minutes / Seconds

Timezone: using your device's local time.

Data Source and Methodology

Authoritative standard: ISO 8601 — Date and time — Representations for information interchange.

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formula Explained

Leap-year rule (Gregorian):

$$\text{Leap}(y) \iff \big(y \bmod 4 = 0\big) \land \big(y \bmod 100 \ne 0\big) \;\; \lor \;\; \big(y \bmod 400 = 0\big).$$

Total seconds and days between timestamps t₁ and t₂:

$$\Delta t = |t_2 - t_1|,\quad \text{TotalDays} = \left\lfloor \frac{\Delta t}{86\,400\ \text{s}} \right\rfloor.$$

Inclusive end date (date-only mode):

$$\text{TotalDays}^{(\text{inclusive})} = \text{TotalDays} + 1.$$

Weeks and remaining days:

$$\text{Weeks} = \left\lfloor \frac{\text{TotalDays}}{7} \right\rfloor,\quad \text{DaysRem} = \text{TotalDays} - 7\cdot\text{Weeks}.$$

Business days (excluding weekends and a holiday set H):

$$\text{BusinessDays} = \sum_{d \in [D_1,D_2]} \mathbf{1}\big(\text{weekday}(d) \notin \{\text{Sat},\text{Sun}\} \land d \notin H\big).$$

Glossary of Variables

How It Works: A Step-by-Step Example

Scenario: Start = 2020-01-15, End = 2024-03-20, Include time = OFF, Include end date = ON, Exclude weekends = OFF.

  1. Compute calendar span by advancing whole years and months from the start until not exceeding the end: 4 years, 2 months, 5 days.
  2. Inclusive total days: from 2020-01-15 to 2024-03-20 inclusive = 1,526 days.
  3. Weeks + days: 1,526 = 218 weeks and 2 days.
  4. Since weekends are not excluded and no holidays are set, business days are equal to the weekday count within the range.

Frequently Asked Questions (FAQ)

What calendar system is used?

The proleptic Gregorian calendar aligned with ISO 8601. Leap years follow the 4/100/400 rule.

Do results change with time zones or DST?

When time is enabled, results use your device's local timezone. Daylight Saving shifts are reflected in hour totals. Date-only computations use local dates at 00:00.

How should I enter holidays?

Use ISO format YYYY-MM-DD, one per line or comma-separated. They are excluded from business day totals if they fall on a weekday within your range.

Is the end date counted?

Only if 'Include the end date' is checked and time-of-day is OFF. With time enabled, precise timestamps make the inclusive option unnecessary.

How accurate is the calendar span (Y M D)?

It is computed by incrementally adding whole years and months from the start without overshooting the end, then counting remaining days—robust across variable month lengths and leap years.

What if I paste an invalid date?

Inline validation flags the field with a helpful message. Fix the format or use the date picker to continue.

Can I compute business days only?

Yes. Turn on 'Exclude weekends' and optionally add holidays. We will display business days alongside total days.

Tool developed by Ugo Candido. Content reviewed by CalcDomain Expert Editorial Team.
Last reviewed for accuracy on: .