Date & Time Tools

How Many Days Between Two Dates? The Counting Rules That Trip Everyone Up

The answer first. To count the days between two dates:

days = (later date) − (earlier date)

That gives the number of nights between them — the exclusive count. If you need to count both endpoints as days (the way hotel stays, hire periods, and "how many days is this festival" questions usually work), add 1.

From 3 March to 10 March: 10 − 3 = 7 days apart, but 8 days inclusive. Almost every disagreement between two date calculators is this one decision, made silently and differently.

Below: the rest of the rules, in the order they actually catch people out.

The Inclusive/Exclusive Question, Settled

Ask what a "day" is being used to measure.

You're counting… Use Example (3 → 10 March)
Nights, elapsed time, a duration Exclusive (plain subtraction) 7
Calendar days occupied, including start and end Inclusive (+1) 8
Days remaining until an event Exclusive from today 7
A rental or hire "for N days" Check the contract — both conventions exist 7 or 8

Do not guess on anything with money or a deadline attached. Notice periods, warranty windows, and legal deadlines usually specify whether the first day counts, and the specification beats the intuition.

Leap Years: The Only Rule You Need

The Gregorian calendar's rule, in full:

  • Divisible by 4 → leap year
  • Except divisible by 100 → not a leap year
  • Except divisible by 400 → leap year after all

So 2024 was a leap year, 1900 was not, and 2000 was. That's why the year 2000 quietly broke a certain amount of software written by people who only implemented the first two clauses.

For counting purposes, the practical effect: any span crossing 29 February gains a day. Manual counts fail here constantly, which is the main reason to let a tool do it once the span crosses a February.

Counting Days Without a Tool

If you need to do it by hand, count in three chunks rather than day by day:

  1. Days left in the start month — from the start date to the end of that month.
  2. Whole months in between — add their lengths (31/30/28-or-29).
  3. Days into the end month — the end date's day number.

From 18 March to 5 June: - March: 31 − 18 = 13 - April + May: 30 + 31 = 61 - June: 5 - Total = 13 + 61 + 5 = 79 days (exclusive). Inclusive: 80.

The knuckle mnemonic still works for month lengths: knuckles are 31-day months, dips are 30 (with February the exception).

Business Days Are a Different Question

"Working days" cannot be computed from the dates alone, because it depends on which days you count as working.

The mechanics: take the total span, subtract weekends, subtract holidays that fall on weekdays. The complications are all in the definitions:

  • The weekend isn't universal. Saturday–Sunday in much of the world; Friday–Saturday in several countries; other patterns exist. A tool that hard-codes Sat/Sun will be wrong for those regions.
  • Holidays are jurisdictional, and some move each year or shift when they land on a weekend. Any business-day calculation needs a holiday list for the specific place, and it must be the current one.
  • Half-days and shutdown periods aren't in any standard list.

So: a business-day count is only as good as the calendar you feed it. If the number matters — a payment term, an SLA, a notice period — confirm the holiday set for the relevant jurisdiction rather than trusting a default.

"One Month Later" Is Not a Number of Days

Date arithmetic in months and years is genuinely ambiguous, and different systems resolve it differently.

What is one month after 31 January? There is no 31 February. The common resolutions are to clamp to the last valid day (28 or 29 February) or to overflow into March. Both are defensible; they give different answers.

And it isn't reversible. Add a month to 31 January, clamp to 28 February, then subtract a month — you get 28 January, not the 31st you started with. Any system doing repeated month arithmetic will drift unless it keeps the original day-of-month as the anchor.

Practical rule: for durations, use days; for schedules, use months. A "30-day payment term" and a "one-month payment term" are different instruments, and mixing them is how invoices end up disputed.

Ages and Anniversaries

Age is not days ÷ 365. Age in years is the count of anniversaries that have already occurred: compare the month and day, and subtract one if the birthday hasn't happened yet this year.

The awkward case is 29 February birthdays in non-leap years, where legal systems and software both make a choice — typically 28 February or 1 March, depending on jurisdiction and implementation. If it matters, check the rule that applies rather than assuming.

Where Tools Disagree

Spreadsheets and the 1900 problem. Excel stores dates as serial numbers and, for backwards compatibility with an old competitor, treats 1900 as a leap year — a 29 February 1900 that never existed. For anything after 1 March 1900 the difference cancels out and subtraction is correct; if you're working with dates before that, verify your results independently. Note also that spreadsheets differ in their zero point, so a raw serial number copied between systems can shift by a couple of days.

For the difference itself, plain subtraction of two date cells is the reliable approach. Excel also carries DATEDIF, a legacy function for year/month/day differences that survives largely for compatibility and is barely documented — useful, but check its output against a manual count the first time you use it.

Timestamps and timezones. Unix timestamps count seconds from 1 January 1970 UTC. Dividing a timestamp difference by 86,400 gives days of elapsed time, which is not the same as the number of calendar days crossed — two moments 20 hours apart can sit on different dates, and two moments 26 hours apart can sit on adjacent dates in one timezone and two days apart in another. Daylight saving transitions make some local days 23 or 25 hours long, so a "day" is not always 86,400 seconds locally. If your two dates come from different zones, normalise first — our timezone difference walkthrough covers how.

Week numbers. ISO 8601 weeks start on Monday, and week 1 is the week containing the first Thursday of the year. Other conventions start weeks on Sunday and define week 1 differently. Two "week 32"s from different systems may not be the same seven days.

Very old dates. Countries switched from the Julian to the Gregorian calendar at different times over several centuries, with days skipped at the changeover. Historical date differences across those transitions need care and a stated convention, not a calculator.

Frequently Asked Questions

Should I add 1 when counting days between two dates? Only if both the start and end day should count as full days — an inclusive count. For elapsed time, nights, or "days until", plain subtraction is correct.

Why do two date calculators give different answers? Almost always inclusive vs exclusive counting. Less often: different timezone handling, or one counting business days.

How do I count days excluding weekends? Take the total span, subtract the weekend days it contains, then subtract any public holidays that fall on weekdays. You must supply the correct holiday list for the jurisdiction.

How many days are in a year for calculation purposes? 365, or 366 in a leap year. Financial conventions sometimes assume 360 or 365 regardless — if you're computing interest, use the convention the contract states, not the calendar.

Is a month always the same number of days? No — 28, 29, 30, or 31. That's why durations should be expressed in days and schedules in months, never interchangeably.

Get the Number, Then Check the Convention

Date maths is easy arithmetic wrapped in hard definitions. The subtraction takes a second; deciding whether to add 1, whether weekends count, and which timezone the dates came from is the actual work.

When you just need the answer, use the free date and time tools on Medley Web — then apply the inclusive/exclusive rule above to make sure it's the number your situation calls for.

Comments are disabled for this article.