Skip to main content

Date Difference Calculator

Number of days, weeks, months, weekdays, or years between two dates

Last updated:

What this calculator computes

Date-difference calculation appears trivial but carries substantial subtlety once business days, holidays, and inclusive-vs-exclusive end-date conventions enter the picture. The calculator takes two date inputs and outputs the duration in multiple forms: total calendar days (the simplest case, computed by Julian-day-number subtraction), total weekdays (Monday through Friday only, useful for business-day deadline calculations), total weeks (calendar days divided by 7), and total months and years using calendar-aware month-length handling. The most common business-context need is the weekday count for contract durations, project deadlines, and payment-term calculations, where weekends and (optionally) holidays do not count toward the deadline. The calculator's weekday-count mode handles the standard Western weekend (Saturday and Sunday non-working) and offers an optional holiday-list parameter for jurisdiction-specific calendar customisation. The other common case is the inclusive-vs-exclusive end-date distinction: a "30-day" payment term can mean 30 calendar days from the invoice date (excluding the issue date itself, due on day 31) or 30 days inclusive (due on day 30); contract law typically defaults to exclusive-of-issue-day counting, but local convention varies. The calculator presents both interpretations to avoid the contractual ambiguity that this distinction routinely produces. Project managers, contract administrators, finance teams, and legal practitioners all encounter the date-difference calculation in slightly different forms, with each professional context having its own conventions about start-date and end-date inclusion.

Calculator

The formula

Formula

days = julian_day(date2) − julian_day(date1)

Worked example

A contract issued on March 15, 2026 specifies a 60-day payment term. Step 1: identify the issue date — March 15, 2026. Step 2: count 60 calendar days forward exclusive of the issue date — March 15 + 60 = May 14, 2026 (60 calendar days later). Step 3: count 60 weekdays forward (excluding weekends, no holidays) — March 15 is a Sunday; counting 60 weekdays forward from Monday March 16 gives June 8, 2026. Step 4: identify the difference between the two interpretations — 60 calendar days falls on May 14, while 60 weekdays falls on June 8, a 25-day gap that depends on whether the contract intends calendar or business days. The disambiguation matters because the late-payment clause depends on which interpretation the issuing party invokes.

When to use this calculator

Use this calculator for any duration calculation involving two specific dates: contract terms, payment schedules, project milestones, vacation planning, fiscal-period calculations, and historical-event spacing. The weekday-count mode is essential for business-context calculations where weekends and holidays do not count, particularly in finance (settlement dates), legal practice (filing deadlines), and project management (working-day estimates). The calendar-day mode is appropriate for personal scheduling, vacation duration, and any context where every day counts equally. The calculator is also useful for gestational-age calculation (where the standard 280-day pregnancy timeline counts from the last menstrual period), construction-project scheduling (where weather days and weekend days affect different parts of the schedule differently), and academic-calendar planning (where breaks and exam periods structure the duration). The calculator does not handle time-zone-shifted date boundaries; both dates are assumed to be in the same time zone, with daylight-saving transitions invisible at the day-level granularity.

Common input mistakes

  • Including or excluding the start date inconsistently between similar calculations. A "30-day" payment term can mean 30 calendar days from the invoice date counted exclusively (due on day 31) or inclusively (due on day 30), and the convention varies by industry, contract, and jurisdiction. Always specify which interpretation the calculation uses, because a one-day discrepancy can determine whether a payment is late or on time.
  • Treating business days as 5/7 of calendar days for weekday-count calculations. Weekend distribution is not uniform across short periods — a 7-day window starting on a Tuesday includes 5 weekdays and 2 weekend days, but a 7-day window starting on a Saturday includes only 5 weekdays distributed differently. For weekday-count work below 30 days, count weekdays explicitly rather than approximating from the calendar-day total.

Frequently asked questions

How do I calculate business days between two dates?

Count only Monday through Friday between the two dates, excluding weekends. For jurisdiction-specific holidays, also subtract the count of holidays falling within the date range — these depend on the country, state or province, and sometimes the industry. The calculator's weekday-count mode handles the basic Saturday-Sunday exclusion automatically; for full holiday-aware counting, supply a holiday-list parameter that names the relevant non-working days within the date range.

Should I count the start date or end date in a duration calculation?

The convention varies by context. Contract law typically counts forward exclusively from the start date and inclusively to the end date, so a "30-day" term issued on March 15 falls due on April 14 (30 days later). Vacation duration typically counts inclusively at both ends, so a vacation from March 15 to March 21 is 7 days. Always specify which interpretation the calculation uses, because the one-day difference can have material consequences in legal and financial contexts.

How many weeks are in a year?

A common year has 365 days, equivalent to 52 weeks and 1 day; a leap year has 366 days, equivalent to 52 weeks and 2 days. The "52-week year" approximation is close enough for most casual usage but produces a small drift in long-running weekly schedules. Standard ISO 8601 weeks are numbered 1 through 52 or 53 depending on the year, with week 1 being the week containing the first Thursday of January.

How do I count days inclusively vs exclusively?

Exclusive day-counting subtracts the start date's Julian-day-number from the end date's, producing the gap in days between them — so March 15 to March 16 is 1 day exclusive. Inclusive day-counting adds 1 to the exclusive figure to count both endpoints, producing the total number of days the date range covers — so March 15 to March 16 is 2 days inclusive. Hospital length-of-stay and hotel-night calculations typically use inclusive counting; contract-term calculations typically use exclusive counting.

How does the calculator handle leap years?

The calculator uses Julian-day-number subtraction internally, which automatically handles leap-year and month-length differences without explicit case-handling. A year-long span that includes February 29 produces 366 days; a year-long span that does not include February 29 produces 365 days. The Julian-day approach treats the calendar as a continuous numbered sequence rather than a structured year-month-day decomposition, eliminating the leap-year edge cases that hand calculations frequently mishandle.

Related calculators