Data source & methodology
AuthoritativeDataSource: ISO 8601 (Parts 1 & 2, 2019) – Data elements and interchange formats — Information interchange — Representation of dates and times; and RFC 3339 (2002) Internet profile. See the ISO 8601 standard and RFC 3339. All computations assume the proleptic Gregorian calendar used by ISO 8601.
Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.
The formula explained
\(\textbf{TotalDays} = d_2 - d_1 + \mathbb{1}_{\{\text{inclusive}\}}\)
\(\textbf{Weeks}\,=\,\left\lfloor\dfrac{\text{TotalDays}}{7}\right\rfloor,\quad \textbf{RemainderDays}=\text{TotalDays}\bmod 7\)
For calendar breakdown (Years–Months–Days), let \(d_1\) be the start date and \(d_2\) the end date (with \(d_2\ge d_1\)). We find integers \(y,m,\delta\) such that:
\[ d_1 + (y\,\text{years}) + (m\,\text{months}) + (\delta\,\text{days}) = d_2,\]
with \(0\le m<12\) and \(0\le \delta < \text{daysInMonth}(d_1+y\,\text{years}+m\,\text{months})\). This is computed by advancing years then months, adjusting for month lengths and leap years per Gregorian rules.
Business days count excludes Saturdays and Sundays and removes any listed holidays \(H\subseteq[d_1,d_2]\):
\[\textbf{BusinessDays} = |\{ d\in[d_1,d_2] : d\notin H,\; \text{weekday}(d)\in\{\text{Mon..Fri}\}\}|.\]
Glossary of variables
- Start date (d₁): First day of the interval.
- End date (d₂): Last day of the interval.
- Inclusive/Exclusive: Whether to count both boundaries.
- Total days: Number of calendar days in the interval.
- Weeks & days: Equivalent weeks plus remaining days.
- Years–Months–Days: Exact calendar interval using Gregorian month lengths.
- Business days: Days excluding weekends and user-listed holidays.
How it works: a step‑by‑step example
Example: Start 2025‑01‑15, End 2025‑03‑02, inclusive, skip weekends, no holidays.
- TotalDays = (Mar 2 − Jan 15) + 1 = 47 + 1 = 48.
- Weeks = ⌊48/7⌋ = 6, RemainderDays = 48 mod 7 = 6 ⇒ 6 weeks 6 days.
- Y–M–D: from 2025‑01‑15 → +1 month = 2025‑02‑15; +0 months more (since 2025‑03‑15 would overshoot); remaining days = 15 → 0 years, 1 month, 15 days.
- Business days: iterate 48 dates, remove Saturdays/Sundays ⇒ 34 business days (no holidays).
FAQ
What happens if the end date is before the start date?
The calculator requires the end date to be on or after the start date. You’ll see a clear error message if that rule is violated.
Do partial days or time zones matter?
This tool counts whole calendar days using local time (00:00). For time‑of‑day differences, use a time duration calculator.
Are leap days counted?
Yes. February 29 is counted when it falls within the interval. Month lengths and leap year rules follow the proleptic Gregorian calendar.
Can I paste holidays from a spreadsheet?
Yes. Paste a column of YYYY‑MM‑DD dates; the tool ignores empty lines and trims whitespace.
Is inclusive mode standard?
Both conventions exist. Legal and HR contexts often prefer inclusive; project scheduling commonly uses exclusive. Set what you need explicitly.
Tool developed by Ugo Candido. Content verified by the CalcDomain Editorial Board.
Last accuracy review: