Date Difference Calculator

Returns the interval between two dates in several units. Days are exact and the rest are not, which is not a shortcoming of the calculation but a property of the calendar: months have no fixed length, so any month count is a convention rather than a measurement.

How to use it

  1. Enter the start date.
  2. Enter the end date.
  3. Read the difference in days, weeks, and approximate months and years.

Days are exact, months are a convention

The day count is unambiguous. Convert both dates to a day number, subtract, and the answer is exact regardless of month lengths or leap years.

Months are the problem. They range from 28 to 31 days, so there is no single correct answer to how many months lie between two dates. The interval from 31 January to 28 February is 28 days — is that one month, or 0.93 of one? Both readings are defensible and different systems choose differently.

Two approaches are in use. Calendar counting increments the month when the day-of-month is reached or exceeded, so 15 January to 15 March is exactly two months. Average-length counting divides days by 30.44, the mean month length in a Gregorian year, which is better for statistical work and worse for anniversaries.

The same applies to years, using 365.2425 days as the mean Gregorian year. This is why an age in years computed by division can differ by a day from the calendar answer around a birthday, and why financial and legal documents specify their day-count convention explicitly rather than leaving it to be inferred.

Inclusive and exclusive counting

Subtracting two dates gives the exclusive count: the number of day boundaries crossed. From 1 March to 5 March is 4 days by subtraction.

But if you are counting days of a hotel stay, days of an event, or days of a rental, you usually want the inclusive count of 5, because both endpoints are days you are paying for. Adding one converts between them.

Which is right depends entirely on the domain, and getting it wrong is an off-by-one error that survives inspection because both answers look reasonable. Hotel nights are exclusive — a Monday check-in and Friday check-out is four nights. Conference days are inclusive. Notice periods and legal deadlines are governed by the specific rule that applies, and those rules commonly exclude the first day, include the last, and extend a deadline falling on a weekend or holiday to the next working day. This calculator gives the exclusive day count; add one where you need the inclusive figure.

Leap years

The Gregorian rule is that years divisible by 4 are leap years, except years divisible by 100, unless also divisible by 400. So 2000 was a leap year, 1900 was not, and 2100 will not be.

The reason for the correction is that a tropical year is about 365.2422 days. A flat four-year rule overcorrects slightly, so the century exceptions bring the average to 365.2425 — accurate to about one day in 3,200 years.

The practical consequences are small but real. February 29 birthdays and anniversaries have no exact counterpart in three years out of four, and different systems handle this differently: some roll to February 28, some to March 1, and contracts occasionally specify. Any interval spanning a leap day includes an extra day, which matters for daily-rate calculations, interest accrual, and subscription proration across a February boundary.

Business days

Many real deadlines are in business days, and the conversion is not a fixed ratio.

The base calculation is straightforward: full weeks times 5, plus weekdays in the partial week. A 30-calendar-day interval contains 21 or 22 weekdays depending on where it starts.

Holidays are the difficulty. They are jurisdiction-specific, some fall on fixed dates and shift when they land on a weekend, and others are defined by rule — the third Monday in January, the last Monday in May. Financial markets, courts, and banks each maintain their own calendars, and they do not agree. A settlement period in business days depends on which calendar governs, which is why cross-border transactions specify it in the contract.

This calculator returns calendar days. For business days, subtract weekends and then the applicable holidays from the relevant calendar.

At a glance

DaysExact, from a day-number difference
MonthsApproximate, using a 30.44 day mean
YearsApproximate, using a 365.2425 day mean
CountingExclusive; add one for inclusive

Frequently asked questions

Why is the month count approximate?

Because months are 28 to 31 days, so there is no single correct answer. The figure here uses a 30.44 day mean, which suits statistics rather than anniversaries.

Should I add a day to the result?

If you need an inclusive count, yes. Subtraction gives day boundaries crossed: 1 March to 5 March is 4 exclusive, 5 inclusive.

Does this handle leap years?

Yes, the day count is exact and includes any leap day in the interval. February 29 anniversaries have no exact counterpart in non-leap years.

Can I get business days?

Not directly. Subtract weekends from the calendar day count, then subtract the holidays from whichever calendar governs your situation.

Read more

Working with dates and time — Days are exact, months are a convention, and two hours a year do not exist or happen twice.

Related calculators