Skip to content

Days Between Two Dates

Count the days, weeks, months and working days between any two dates. Handles leap years and month lengths properly. Runs in your browser.

Runs entirely in your browser — nothing is uploaded

Pick both dates.

How the working days are counted

Weekdays from the day after the first date through to the second date inclusive. That answers “how many working days do I have until the deadline”, which is what people are nearly always asking.

Every tool picks a different convention here and most never say which, so two calculators disagreeing by a day or two is normal. This one states its rule so you can adjust rather than guess.

Public holidays are not included. They differ by country, by region and by year, and a tool that guessed would be quietly wrong for most of the people using it. Subtract the ones that apply where you are.

Why the months do not divide neatly into the days

Because months are not a fixed length. Two months from 31 December is 28 February in a common year — 59 days. The same two months from 31 May is 31 July — 62 days. Any breakdown into years, months and days has to pick a rule, and there is no rule that makes them all consistent.

The rule here is to count whole calendar months first and then measure the leftover days from that point. So 31 January to 1 March comes out as one month and one day, because one month after 31 January lands on the last day of February. Naive subtraction gives minus thirty days, which is how a surprising number of tools get this wrong.

Leap years, including the awkward part

Handled, and that includes the century rule most people have forgotten: a year divisible by 100 is not a leap year unless it is also divisible by 400. 2000 was one. 1900 was not, and 2100 will not be.

A date that does not exist — 29 February in a common year, or 31 April — is rejected rather than silently rolled forward into the next month, which is what a plain date object does by default and a genuine source of off-by-one errors.

Everything is worked out in your browser

The dates are never sent anywhere, and the page keeps working offline. The sums are done in UTC deliberately: doing them in local time makes an interval come out a day short across a daylight-saving boundary, which is the kind of bug that only appears for half the year and only in some countries.

Frequently asked questions

How are working days counted?

Weekdays from the day after the first date through to the second date inclusive. That answers “how many working days do I have until the deadline”, which is what people are nearly always asking. Every tool picks a different convention here and most do not say which, so this one is stated outright.

Does it know about public holidays?

No, and it would be misleading to pretend otherwise. Holidays differ by country, by region and by year, and a tool that guessed would be quietly wrong for most visitors. Subtract the ones that apply to you from the working-day figure.

Why do the months and days not match the total days?

Because months are not a fixed length. Two months from 31 December is 28 February in a common year, and the same span from 31 May is 31 July — 62 days rather than 59. The breakdown counts whole calendar months first and measures the remainder from there, which is why 31 January to 1 March comes out as one month and one day.

Are leap years handled?

Yes, including the century rule: 2000 was a leap year, 1900 and 2100 are not. An invalid date such as 29 February in a common year is rejected rather than silently rolled forward into March, which is what a plain date object does by default.

Does the order of the dates matter?

No. Putting the later date first gives the same span, and the tool says it noticed rather than returning a negative number nobody wants.