Skip to content
Este site está disponível em português
Toolbench

Try: compress pdf, iphone photo, 15% of 240

    Days Between Two Dates

    Days, weeks, months and working days between two dates.

    Type the date as mm/dd/yyyy, or use the calendar button.
    Type the date as mm/dd/yyyy, or use the calendar button.

    Fill in the fields and the answer appears here.

    0 requests sent with your numbers
    How this was worked out

    Fill in the fields and the answer appears here.

    Guide: How the working days are counted3 min read

    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.

    National holidays, when you pick a country. Choose the United States or Brazil and that country's public holidays come out of the working days, the moveable ones worked out for the year. Local ones — a state's, a city's — differ from place to place and are not guessed: 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?

    National ones, when you pick a country: choose the United States or Brazil and its public holidays come out of the working days, the moveable ones worked out for the year. Local holidays — a state's, a city's — differ from place to place and are not guessed; subtract the ones that apply to you.

    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.

    Same drawer