Skip to content
Utility

Date Difference Calculator

A precise date-difference calculator. Pick two dates and see the gap in every common unit, plus a calendar Y/M/D breakdown and a count of business days between them.

Difference

0y 0mo 0d

Pick two dates above.

Total days

0

Total weeks

0

Total months

0

Hours

0

Minutes

0

Business days

0

Method

How this calculator works

The difference between two dates is the elapsed time between them. We display it as a calendar breakdown plus several total-unit views.

difference = endDate − startDate

# Calendar breakdown
years   = end.year - start.year
months  = end.month - start.month
days    = end.day - start.day
# borrow if days/months are negative

# Totals derive from the millisecond difference
totalDays    = floor(|ms| / 86,400,000)
totalWeeks   = floor(totalDays / 7)
totalHours   = floor(|ms| / 3,600,000)
totalMinutes = floor(|ms| / 60,000)
  1. Pick a start date and an end date — either order, the calculator shows the absolute gap.
  2. It computes the raw millisecond difference and divides by the right constants to produce days, weeks, hours, and minutes.
  3. A separate calendar arithmetic pass produces the human-friendly Y/M/D breakdown.
  4. Business days are counted by stepping through each day and skipping Saturdays and Sundays.

Examples

Worked examples

Real numbers, end-to-end results.

Jan 1, 2025 → Jun 5, 2026

1 yr, 5 mo, 4 days · 521 days · 372 business days

Total months: 17.

Mar 12, 2000 → Jun 5, 2026

26 yrs, 2 mo, 24 days · 9,581 days

About 1,369 weeks.

Use cases

When to use it

  • Plan project timelines — how many business days are left until launch?
  • Calculate the precise age of a relationship, anniversary, or pet.
  • Verify employment-tenure milestones (e.g. five-year vesting cliffs).
  • Schedule reminders for events that are exactly N days, weeks, or months away.

FAQ

Frequently asked questions

How is the difference calculated?
We compute the millisecond difference between the two dates and convert it to days, weeks, hours, and minutes. The calendar Y/M/D breakdown uses the standard borrow-from-previous-month algorithm.
Does it account for leap years and DST?
Yes. JavaScript’s Date object respects both, so totals reflect actual elapsed time. The Y/M/D breakdown handles February 29 correctly.
What counts as a "business day"?
Monday through Friday. Public holidays are not removed — that varies by country, so a generic calculator can’t handle every region’s holiday calendar accurately.
Why does swapping dates not change anything?
The calculator always shows the absolute difference between the two dates. Whether June is "before" or "after" December, the gap is six months either way.