DigitHelm

Date Difference Calculator | Days Between Two Dates

Calculate the exact number of calendar days, business days, weeks, months, and years between any two dates. Includes hours, minutes, seconds, leap year count, and inclusive/exclusive endpoint options.

Quick presets

Select two dates above or pick a quick preset to see the difference.

What Is the Date Difference Calculator | Days Between Two Dates?

At its core, a date difference is computed by converting both dates to a numeric day count (typically days since a fixed epoch like January 1, 1970, Unix time) and subtracting. The result is an exact integer count of calendar days between the two dates, independent of time zones.

The years-months-days breakdown is trickier because months have different lengths (28–31 days) and years have different lengths (365 or 366 days in leap years). This calculator adjusts for those irregularities: it starts from the whole-year difference, then counts whole months, then counts remaining days in the final partial month.

Business days (also called working days) are weekdays only, Monday through Friday. This calculator excludes Saturdays and Sundays but does not account for public holidays, which vary by country and year. For deadline and contract calculations, confirm which holidays apply in your jurisdiction.

Formula

Date Difference, Core Formula

Δ days = Date₂ − Date₁ (calendar days)

Δ weeks = ⌊Δ days / 7⌋ remainder Δ days mod 7

Δ hours = Δ days × 24

Δ minutes= Δ days × 1,440

Δ seconds= Δ days × 86,400

Include end date:

Δ days (inclusive) = Date₂ − Date₁ + 1

Business Days Formula

Full weeks = ⌊Δ days / 7⌋

Business days= Full weeks × 5

+ working days in the remaining partial week

Note:

Excludes Saturdays and Sundays only.

Public holidays vary by country and are not excluded.

UnitConversion from daysExample: 100 days
Hoursdays × 242,400 hours
Minutesdays × 1,440144,000 minutes
Secondsdays × 86,4008,640,000 seconds
Weeksdays ÷ 714 weeks 2 days
Monthsdays ÷ 30.44≈ 3.28 months (approx)
Yearsdays ÷ 365.25≈ 0.274 years (approx)

How to Use

  1. 1Enter dates: Type or pick a Start Date and an End Date. Results update automatically, no need to press Calculate.
  2. 2Use presets: Click a quick preset (e.g. "Last 30 days" or "Year to date") to load common ranges instantly.
  3. 3Swap dates: Click ⇄ Swap to reverse the two dates without re-entering them.
  4. 4Include end date: Check the "Include end date" box to count both endpoints (adds 1 day to the total).
  5. 5Read results: See total calendar days, business days, weeks, months, and a full breakdown in hours/minutes/seconds.
  6. 6Reset: Click Reset or press Esc to clear all fields and start fresh.

Example Calculation

Example 1, Project Deadline

  • Project start: January 6, 2025 (Monday). Deadline: March 28, 2025 (Friday).
  • Calendar days: 81 days total.
  • Business days: 57 working days (Mon–Fri, excluding weekends).
  • Weekend days: 24 (12 Saturdays + 12 Sundays).
  • Breakdown: 2 months, 22 days, or 11 full weeks + 4 remaining days.

Example 2, Anniversary Countdown

  • Wedding date: June 15, 2019. Today: April 13, 2026.
  • Total: 2,494 calendar days (just under 6 years 10 months).
  • Breakdown: 6 years, 9 months, 29 days.
  • Business days: approximately 1,781 working days.
  • Leap years with Feb 29 in range: 2 (2020 and 2024).

Example 3, Contract Duration (inclusive count)

  • Contract runs from May 1 to May 31, you want to count both endpoints.
  • Exclusive (default): 30 days. Inclusive (tick the checkbox): 31 days.
  • The inclusive count is often used in legal documents ("from the 1st through the 31st inclusive").
  • Business days inclusive: 23 (May 2026 has 1 holiday-free weekend days excluded).
  • Rule of thumb: for "including both ends" contracts, always use the inclusive option.

Understanding Date Difference | Days Between Two Dates

Why Date Differences Matter

Calculating the number of days between two dates is one of the most common practical math problems. It shows up in contract management (when does the 30-day notice period expire?), project planning (how many working days until the deadline?), healthcare (how many days since a procedure?), finance (how many days in a billing period?), and everyday life (how long until the vacation?).

Despite being conceptually simple, calendar arithmetic is surprisingly tricky. Months have 28, 29, 30, or 31 days. Years are either 365 or 366 days. Counting "2 months from January 31" could mean March 31 (most intuitive) or March 28/29 (if you count exactly 60/61 days). This calculator follows the standard Gregorian calendar definition used in most legal and business contexts.

Common Date Difference Use Cases

Use caseWhat to calculateCount type
Notice period (legal)Days from notice to expiryCalendar days
Project deadlineWorking days until due dateBusiness days
Invoice net terms (Net 30)Days from invoice date to dueCalendar days
Employee probation periodMonths + days from start dateCalendar / Y-M-D
Drug/vaccine efficacy studyDays between doses or follow-upsCalendar days
Loan repayment periodDays between drawdown and repayCalendar days
Anniversary / birthdayYears + months + days since dateY-M-D breakdown
Delivery lead timeBusiness days from order to shipBusiness days

Inclusive vs. Exclusive Date Counting

The choice between inclusive and exclusive endpoints is often overlooked but matters in practice. If a contract says "the period from May 1 to May 31", does that include both May 1 and May 31? Usually yes, that is an inclusive count of 31 days. But if a system calculates "days since May 1" and today is May 31, the answer is 30 days exclusive (May 1 is day 0, May 31 is day 30).

  • Exclusive (default): Days between, not counting the end date. "From Mon to Fri" = 4 days. Used in most software and date APIs.
  • Inclusive: Counting both endpoints. "From Mon through Fri" = 5 days. Common in legal texts, rental periods, and event durations.

Frequently Asked Questions

Does the calculator count the start date or the end date?

  • By default, the calculator counts the interval between dates, it counts the start date but NOT the end date.
  • Example: Jan 1 to Jan 3 = 2 days (Jan 1 and Jan 2 are counted; Jan 3 is the boundary).
  • Check "Include end date" to add 1 day and count both endpoints.
  • Inclusive counting is common in legal and HR contexts where "from Monday through Friday" means 5 days.

How are business days calculated?

  • Business days (working days) are weekdays only: Monday, Tuesday, Wednesday, Thursday, Friday.
  • Saturday and Sunday are always excluded regardless of jurisdiction.
  • Public holidays are NOT excluded, they vary by country, state, and year.
  • For deadline calculations with holidays, subtract the relevant public holidays from the business day count.
  • Example: 14 calendar days starting on a Monday = 10 business days (2 full weekends removed).

Why does the "months" result look approximate?

  • Calendar months have different lengths (28, 29, 30, or 31 days) so there is no fixed days-per-month.
  • This calculator computes exact years + months + remaining days from the calendar.
  • The "approx months" card multiplies years×12 + whole months, it ignores the remaining partial month.
  • Example: Jan 1 to Mar 15 = 2 months 14 days. The approx count shows 2; the exact breakdown shows 2m 14d.

What happens if the end date is before the start date?

  • The calculator automatically handles reversed dates, it always shows the absolute (positive) difference.
  • The summary banner labels which date is earlier and which is later, so context is never lost.
  • Alternatively, use the ⇄ Swap button to reverse the two dates while keeping the same values.
  • There is no error for reversed dates, entering them in either order gives the same day count.

How many days are in a year, exactly?

  • A common year has 365 days. A leap year has 366 days (an extra day added on February 29).
  • The average Gregorian calendar year is 365.2425 days, the basis for the "365.25" approximation.
  • A leap year occurs when the year is divisible by 4, except for century years (1900, 2100), unless divisible by 400 (2000, 2400).
  • For date arithmetic, this calculator uses exact calendar dates rather than an average year length.

Can I use this to calculate how long until a future date?

  • Yes, set today as the Start Date (click "Set to today") and enter your future event as the End Date.
  • The result shows days remaining, business days remaining, weeks, and a full breakdown.
  • Use the "Days until New Year" preset as a quick example of a forward countdown.
  • For a live real-time countdown with hours/minutes/seconds, see the Countdown Calculator.

What is the difference between calendar days and working days?

  • Calendar days count every day in the range, including weekends and holidays.
  • Working days (business days) count only weekdays: Monday through Friday.
  • A typical work week is 5 business days out of 7 calendar days.
  • Over a year, there are approximately 260 business days (52 weeks × 5) minus holidays.
  • Legal contracts, SLAs, and employment terms often specify which type of day applies.

How accurate is the date difference calculation?

  • The calendar day count is exact, it uses millisecond-precision arithmetic on Unix timestamps.
  • The years/months/days breakdown follows the standard Gregorian calendar definition.
  • Leap years are correctly handled: e.g., Jan 1, 2020 to Jan 1, 2021 = 366 days (2020 was a leap year).
  • Time zone differences are not relevant for date-only calculations, all inputs are treated as midnight local time.
  • No rounding errors affect whole-day results; fractional results (hours, minutes) are exact multiples.

Related Calculators