Skip to the tool
DevToolBench

Date Difference Calculator

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

Everything runs in your browser. Nothing you type is sent to a server.

Found a bug in this tool? Report it.

Share this tool

Two dates, and the arithmetic between them

A date difference calculator answers a question that sounds like it has one answer and turns out to have several. Put 1 September and 30 September into the boxes above and you get 29 days, four weeks and one day, twenty-one working days, and zero months plus twenty-nine days — all of them correct, all of them the answer to a slightly different question. This page shows every reading at once so you can pick the one your form, contract or migration script actually wants.

Type two dates, or switch to age mode and give a date of birth. Add a time of day if the interval is short enough for hours to matter. Nothing is uploaded.

The inclusive question, which nobody asks out loud

"Days between two dates" is ambiguous in ordinary English and precise in exactly two ways. Counting the gaps between the dates gives the exclusive answer, and it is what a notice period, a countdown or a cache expiry wants. Counting the days themselves gives the inclusive answer, one higher, and it is what a hotel invoice, a sick note and an annual leave request all use.

Getting this wrong is the classic off-by-one, and it is expensive precisely because both numbers look plausible. A five-day booking from Monday to Friday is charged as five nights by nobody and five days by everybody, and a contractor who invoices exclusively for an inclusive period loses a day per engagement, quietly, forever. Decide which convention the document uses before you copy the figure.

Months have no length, so months need an anchor

Thirty days is not a month; it is the length of April. The interval from 31 January to 31 March is fifty-nine days, and the interval from 31 May to 31 July is sixty-one — two months in both cases, different in reality by two days.

Because of that, "one month and four days" is only meaningful once you say where the month was measured from. This page measures forwards from the start date, adding whole months for as long as they still land on or before the end, then counting the remaining days. Where the start day does not exist in the target month it is clamped to the last day that does, which is why 31 January plus one month is 28 February — or 29 February in a leap year. That is the convention British contracts use and the one every spreadsheet function implements, but it is a convention, not a law of arithmetic: add a month twice from 31 January and you land on 28 March, not 31 March.

The day with twenty-three hours

All of the arithmetic here runs in UTC, using explicit UTC constructors, and that is deliberate. On 29 March 2026 the clocks in Britain went forward at 01:00, so that day had twenty-three hours. A naive subtraction of two local midnights across that boundary produces 82,800,000 milliseconds, which divides into zero point nine six of a day and floors to zero. The bug appears once a year, in spring, and reproduces on nobody's machine but the reporter's.

Keeping the whole calculation in UTC removes the problem rather than compensating for it. If you need the wall-clock reading of an instant instead, the Unix timestamp converter shows the same moment in UTC and in your own zone side by side.

Age, and the birthdays that do not exist

Age mode measures from a date of birth to right now, in completed years, months and days — never rounded up, because a person is not thirty-one until the day arrives. It also names the next anniversary, which is where 29 February gets interesting: in a common year the anniversary is read as 28 February, the rule British law applies for coming of age and the one every registration form follows without saying so.

Scheduling something on that interval rather than measuring it? The cron every month page explains why a monthly job on the 31st skips February altogether, and cron every day at midnight covers what happens to a daily job on the night the clocks change.

Frequently asked questions

Should I include the end day in the count?

It depends what the number is for. A deadline is exclusive — from Monday to Friday is four days of waiting. A stay, a hire or a period of leave is inclusive — a holiday from Monday to Friday is five days off, and every booking system in the world charges you for five. The checkbox above switches between the two, and the report says which one produced the figure.

Why does the tool say one month and one day, not thirty-one days?

Because a month has no fixed length, so a month-and-day answer has to be anchored somewhere. This page anchors it on the start date, adds whole months while they still fit before the end date, and counts the leftover days from there. From 31 January the first whole month lands on 28 February, so 1 March reads as one month and one day.

Does a leap year change the answer?

Only when the interval crosses 29 February. From 28 February to 1 March is two days in 2024 and one day in 2026, and every span that contains a 29 February is one day longer than the same span a year earlier. The page reads the real calendar rather than assuming 365, so the difference shows up on its own.

How are working days counted here?

Monday to Friday, over the calendar days the interval crosses, with no public holidays subtracted. Bank holidays differ between England, Scotland and Northern Ireland, and again between countries, so a single number would be wrong for most readers. Take the figure as the ceiling and subtract the holidays your own calendar has.

Is my birth date sent anywhere?

No. Every calculation on this page happens in the tab you are reading, in JavaScript, and nothing you type leaves the device. There is no request to make: the arithmetic is a subtraction and a handful of calendar rules.

Related tools

Updated