Date Difference Calculator

Whether you are measuring a project timeline, a notice period, a warranty window or the gap between two milestones, the core question is the same: how many days lie between date A and date B? This calculator answers that in days, weeks, months and years, and makes clear whether the count includes both endpoints or only the space between them.

Enter values

Day of first date (1–31)

Month of first date (1–12)

Year of first date (e.g. 2024)

Day of second date (1–31)

Month of second date (1–12)

Year of second date (e.g. 2024)

Results update as you type.

Results

Days between (exclusive)
365
Days between (inclusive)
366
Weeks
52.14
Months (approx.)
11.99
Years (approx.)
1

How is the Date Difference calculated?

Enter the first date (day, month, year) and the second date. Order does not matter — the calculator always returns a positive span. The headline figure is exclusive days (the number of midnights between the dates). An inclusive count adds one, useful for 'from 1 Jan to 31 Jan inclusive' scenarios. Weeks, months and years are derived from the day count using average month and year lengths.

Formula

Exclusive days = UTC date2 − UTC date1 in whole days. Inclusive days = exclusive days + 1. Weeks = exclusive days ÷ 7. Months ≈ exclusive days ÷ 30.436875 (average Gregorian month). Years ≈ exclusive days ÷ 365.2425 (average Gregorian year). All arithmetic uses UTC midnight to avoid DST shifts.

Example

From 1 January 2024 to 31 December 2024 (a leap year): exclusive days = 365, inclusive days = 366, weeks = 52.14, months ≈ 12.00, years ≈ 1.00. Swapping the two dates returns the same span, because order does not matter. From 29 February 2024 to 1 March 2024: exclusive days = 1, inclusive days = 2, weeks ≈ 0.14. From 1 March 2024 to 31 March 2024: exclusive days = 30, inclusive days = 31, weeks ≈ 4.29, months ≈ 0.99.

Things to remember

Use exclusive days for 'how many days until' and inclusive days for 'how many days during'. The week, month and year figures are approximations — for contractual or legal deadlines, rely on the exact day count and verify the inclusive/exclusive convention the contract uses.

Frequently Asked Questions

What is the difference between inclusive and exclusive day counts?

Exclusive counts the midnights between two dates (1 Jan to 2 Jan = 1 day). Inclusive adds both endpoints (1 Jan to 2 Jan = 2 days). Project plans often use inclusive; 'days until' uses exclusive.

Why are months and years shown as decimals?

Months vary from 28 to 31 days and years from 365 to 366, so a single average is used: 30.436875 days per month, 365.2425 days per year. For exact month counts, use the add-days calculator with month rollovers.

Does the calculator handle leap years correctly?

Yes. 29 February 2024 to 1 March 2024 returns 1 exclusive day. A full leap year span (1 Jan 2024 to 1 Jan 2025) returns 366 exclusive days.

Can I enter dates in any order?

Yes. The calculator always returns a positive span regardless of which date comes first, so swapping the two dates gives the identical day count. Only the absolute gap between the dates matters, which is handy when a document lists two milestones without making clear which one happened earlier.