Home › Guides

How to count the days between two dates

“How many days until…” sounds like the simplest question in date math. It has at least two right answers, and which one you need depends on what you're counting.

Published 31 October 2026

Ask two people how many days there are from 1 March to 10 March and you may get two answers: nine and ten. Both are correct. They're counting different things, and most disagreements about date calculations come down to which one was meant.

Exclusive counts: the gap between two dates

The default in most calculators, spreadsheets and programming languages is the difference between two dates: how many midnights you cross going from one to the other. From 1 March to 10 March that's 9. From today to tomorrow it's 1. From a date to itself it's 0.

This is the right count for durations and countdowns. "How many days until my flight" means how many times you'll wake up before it, which is the exclusive count.

Inclusive counts: how many calendar days are covered

Sometimes you need to count both the first and the last day. A hotel booking from 1 to 10 March covers ten calendar dates (but only nine nights). A ten-day course running 1–10 March has ten class days. Leave requests, rental periods priced per day, and event durations are usually inclusive.

The conversion is always the same: inclusive = exclusive + 1. The date calculator shows both so you can pick the one that matches your situation.

Why months are the hard part

Days and weeks are fixed lengths. Months aren't: they run 28, 29, 30 or 31 days. So "one month after 31 January" has no single correct answer, because there is no 31 February. Systems resolve it in different ways:

Neither is wrong. They're conventions, and a good tool tells you which one it uses. The same issue shows up in reverse: is 31 March to 30 April "one month"? Under the clamping convention, one month after 31 March is 30 April, so yes.

This is also why an answer like "2 months and 3 days" can differ slightly between calculators, even when the total day count agrees.

Leap years

Any span that includes 29 February is one day longer than the same span in a common year. Calculators that work by converting both dates to an absolute day number and subtracting get this right automatically. Calculators that add up month lengths can get it wrong if they hard-code February as 28 days. The leap year guide explains the full rule, including why 1900 wasn't a leap year.

Daylight saving and the 23-hour day

A quieter bug: if you work out the number of days by subtracting two timestamps and dividing by 24 hours, you'll occasionally be off by one. The day the clocks go forward is only 23 hours long, and the day they go back is 25. Midnight to midnight across a spring change is 23 hours, which divides to 0.958 days. Round down and you've lost a day.

The fix is to count calendar dates, not hours: treat each date as a whole day regardless of how many hours it had. Everything on this site does date math this way.

Weeks, business days and "working days"

Weeks are just days divided by seven, but people often want "weeks and days" (seventeen days is 2 weeks and 3 days). Business days are different: they skip weekends and, usually, public holidays. Ten calendar days might contain only six or seven business days. Which days count as the weekend, and which holidays apply, depends on the country and sometimes the employer. The business days calculator lets you set both.

Checking a calculation by hand

For short spans within one month, subtract the day numbers: 3 to 21 March is 18 days. Across months, count to the end of the first month, add the full months in between, then add the days into the last month. For 20 January to 5 April 2026:

Total: 75 days (exclusive), or 76 if you count both ends. For longer spans, or anything you need to rely on, use a calculator. But this method is a good check when a number looks wrong.

Day of the year

A related shortcut: many fields (logistics, agriculture, manufacturing) use the day of the year, from 1 for 1 January to 365 or 366 for 31 December. The difference between two day-of-year numbers in the same year is the exclusive day count. ISO week numbers are another way of slicing the year, covered in the ISO week guide.

Frequently asked questions

Does the date calculator include the end date?

By default it shows the exclusive difference (the gap between the dates) and also shows the inclusive count, which adds one day to include both the start and the end.

How many days is it from Monday to Friday?

Four days exclusive, five days inclusive. If you mean working days in a normal Monday-to-Friday week, it's five.

What is one month after January 31?

It depends on the convention. Most spreadsheets clamp to the end of February (28 or 29 February); a naive programming calculation overflows into early March.

Why is my day count off by one?

Usually because one result counts both ends and the other doesn't, or because a calculation divided hours by 24 across a daylight saving change.