Timeyard

Date math حساب تاریخ

How to calculate the number of days between two dates

On this pageدر این صفحه

Counting days sounds trivial until you actually try it across a month boundary. “How many days from 14 February to 3 April?” Quick, no peeking. It’s the kind of thing your brain wants to round to “about seven weeks” and move on.

Here’s the tool first, since most people land here wanting the answer, not a lecture:

Count the days between any two dates, Shamsi or Gregorian شمار روزهای میان دو تاریخ، شمسی یا میلادی

The method, when you want to do it by hand

The reliable approach is the same one the calculator uses under the hood:

  1. Count the days left in the starting month after your first date.
  2. Add the full days in every whole month in between.
  3. Add the day-of-month of your end date.

That’s it. No tricks, just bookkeeping. The only thing that bites people is February, which flips between 28 and 29 days depending on whether the year is a leap year (and the Persian calendar has its own leap rule, covered in Persian leap years, explained). For a countdown to one specific date, see days until Nowruz. The underlying “days between two dates” idea is exactly how serial date numbers work in spreadsheets (source: Microsoft, DATEDIF function).

A worked example

Say you want the gap between 1 January 2026 and 31 December 2026.

StepValue
Days left in January after the 1st30
February through November (full months)303
Day-of-month in December31
Total364 days

So 1 Jan to 31 Dec in 2026 is 364 days, not 365, because you’re counting the gap between two dates, not the length of the year. Off-by-one errors here are incredibly common, which is half the reason the tool exists.

And a leap-year check: 28 February 2024 to 1 March 2024 is 2 days (the 29th sits in between), while the same span in 2025 is just 1 day. Same dates, different answer, purely because 2024 is a leap year.

Why a calculator beats mental math here

Mental math is fine for short spans. Past a month or two it gets fiddly fast, and it’s easy to slip: a miscounted February, a month you thought had 31 days, an inclusive-vs-exclusive mistake. The date difference calculator sidesteps all of it and throws in total weeks, total months, and working days (weekends excluded) for free.

A couple of related things on this site if you’re doing date math:

Every calculation runs on your device, nothing gets sent anywhere.

Frequently asked questions

  • Does the count include both the start and end date?

    No, it’s the gap between them. 1 January to 2 January is 1 day. If you need both endpoints counted (an "inclusive" count), add 1.

  • How do I count days across a leap year?

    Just include 29 February if the span crosses it. The tool handles this automatically; by hand, check whether the year is divisible by 4 (with the century exception).

  • Can I count days between two Persian (Shamsi) dates?

    Yes. Each date input has a Shamsi / Gregorian toggle, so you can use either calendar, or mix them. The day count is the same real number of days regardless.

  • What about working days only?

    Open the calculator’s details: it reports working days (Monday–Friday, weekends removed) alongside the raw total.

Open the converter بازگشت به مبدّل