HomeEveryday Life › Date Difference Calculator

Date Difference Calculator

Counts the days between two ISO dates and expresses the gap as weeks and days, as a calendar breakdown in years, months and days, and as business days (Monday–Friday, public holidays not excluded).

When to use

You need the number of days, weeks or working days between two dates, or a calendar-style 'x years y months z days' difference.

Do not use when: You want to add or subtract a number of days from a date (use add-days), or you need an age with the next birthday (use age).

Formula

days = end_date − start_date (+1 if include_end_date); weeks = floor(days / 7); remaining_days = days mod 7; business_days = number of Mon–Fri dates in [start_date, end_date) or [start_date, end_date] when inclusive; calendar breakdown = whole years, months, then days borrowed from the month before end_date

Counts calendar days in UTC without times of day. By default the count is exclusive of end_date, so Monday to Friday of one week is 4 days and 4 business days; set include_end_date for 5.

Inputs

ParameterTypeUnitRequiredDescription
start_datedateyesFirst date (ISO 8601, YYYY-MM-DD).
end_datedateyesSecond date (YYYY-MM-DD). If it is earlier than start_date the dates are swapped and a note is returned.
include_end_datebooleandefault falsetrue counts both endpoints (adds one day to days, weeks/days and business_days), e.g. for inclusive rental or leave periods.

Outputs

OutputTypeUnitDescription
daysintegerdaysend_date − start_date in days (+1 when include_end_date is true).
weeksintegerweeksfloor(days / 7).
remaining_daysintegerdaysdays − 7 × weeks.
weeks_and_daysstringSame gap written as weeks and days.
calendar_yearsintegerWhole years between the two dates (not affected by include_end_date).
calendar_monthsintegerWhole months beyond the years.
calendar_daysintegerDays beyond the whole months.
calendar_textstringYears, months and days written out (zero parts omitted).
business_daysintegerdaysMondays to Fridays among the counted days (public holidays are not excluded).

Example

2026-01-01 to 2026-12-25: {"start_date":"2026-01-01","end_date":"2026-12-25"}{"days":358,"weeks":51,"remaining_days":1,"weeks_and_days":"51 weeks 1 day","calendar_years":0,"calendar_months":11,"calendar_days":24,"calendar_text":"11 months 24 days","business_days":256}

2025-11-05 to 2026-03-15 inclusive: {"start_date":"2025-11-05","end_date":"2026-03-15","include_end_date":true}{"days":131,"weeks":18,"remaining_days":5,"weeks_and_days":"18 weeks 5 days","calendar_months":4,"calendar_days":10,"calendar_text":"4 months 10 days","business_days":93}

GET https://tttkmbb.com/api/v1/calculate/date-difference?start_date=2026-01-01&end_date=2026-12-25

Machine access

Sources

FAQ

Does business_days exclude public holidays?

No. It only excludes Saturdays and Sundays; subtract the holidays of your jurisdiction yourself.

Why does the calendar breakdown not add up to the day count?

Months have different lengths, so 'x months y days' is a calendar convention: whole months are counted first and the leftover days are borrowed from the month preceding end_date.

Related calculators