date→days

Date Difference Calculator

How long between two dates, in every unit you might need it.

By opening this website or using its tools, you agree to our Terms and Privacy Policy.

Enter two valid dates to see the difference.

Network activity during processing
0 bytes uploaded

Your file never leaves your browser during processing

How it works

To find the number of days between two dates, enter them above — the difference is shown in days, weeks, months, and years at once, with a switch for whether the end date counts as a full day.

The day count is computed by converting both dates to a fixed point in the calendar and subtracting, rather than by adding up hours. That distinction matters because a day is not always 24 hours long: across a daylight saving transition it is 23 or 25, and any calculation done in elapsed time drifts by one day roughly twice a year. Counting calendar days directly is exact everywhere, and the hour and minute figures shown lower down are conversions of that day count, labelled as such. To leave weekends and public holidays out, count only the working days between the two dates instead.

The years-months-days breakdown is a genuinely harder problem than it sounds, because months have different lengths. The naive approach — subtract the years, subtract the months, subtract the days, borrow when something goes negative — produces nonsense at month boundaries: from 31 January to 1 March it tries to borrow 29 days out of February and still comes up short. This page instead finds the largest whole number of months that fits inside the span, then measures what is left in exact days, which makes the answer reversible: adding the breakdown back to the start date always returns the end date. It is the same breakdown the age calculator reports, measured from a date of birth.

The "count the end date as a full day" switch exists because both readings are correct and they differ by one. A hotel stay from the 3rd to the 6th is three nights. A conference running the 3rd to the 6th lasts four days. Neither is the default answer to "how many days between", so both are available and the label says which is which rather than leaving you to work out what was assumed. To see which weekday either date falls on, look up the day of the week.

Background reading: Business days, working days and calendar days.

FAQ

How many days are between two dates?

Enter both dates above and the count appears immediately. By default it counts the gap between them; tick "count the end date as a full day" to include both endpoints, which adds one.

Why do I get two different answers depending on the switch?

Because both are right for different questions. "How many nights" or "how long until" wants the gap; "how many days does the event run" wants both endpoints counted. The two always differ by exactly one day.

Does this account for leap years?

Yes. The calculation works on real calendar dates, so 29 February is included whenever it falls inside the range.

How is the months figure calculated?

It is the number of whole months that fit between the dates, with the remainder shown in days. Because months vary in length, "1 month and 3 days" from a given start date is a different number of days depending on which month you start in.

Are the hours and minutes exact?

They are the day count multiplied out, so they assume every day is 24 hours. If your range crosses a daylight saving change, the true elapsed time differs by an hour.

Related tools