ThisCalculator

Date and time

Calculate Between Dates: Days, Weeks, Months

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Calculate Between Dates: Days, Weeks, Months

This calculator works out the exact time span between two dates—the number of days, weeks, and months from a start date to an end date. You enter the two dates, and you get back the total days, the equivalent in weeks and days, and the calendar months and remaining days. It handles leap years and month-length differences automatically, so you don’t have to count on your fingers.

Formula

The core calculation is simple subtraction of one calendar date from another:

Total days = End date − Start date

Each date is converted to a serial number (the number of days since a fixed reference point, such as 1900-01-01). The difference between those serial numbers is the number of whole days between the two dates. For weeks and months:

  • Weeks = floor(Total days ÷ 7)
  • Remaining days = Total days mod 7
  • Months (approximate) = floor(Total days ÷ 30.4375)

The constant 30.4375 is the average number of days per month over a full 400-year Gregorian calendar cycle (365.2425 days per year ÷ 12 months). It gives a useful approximation, but for exact month counting, you need to look at the calendar months themselves.

Worked Example

Using the default values: start date 2024-01-01 and end date 2024-12-31.

  1. Count the days from January 1 to December 31, 2024. Since 2024 is a leap year, it has 366 days. The difference is 365 days (because the start day is included in the count, but the end day is the 366th day). Actually, let’s be precise: the number of days between Jan 1 and Dec 31 is 365 (Dec 31 is day 366, minus 1 = 365).
  2. Total days = 365
  3. Weeks = floor(365 ÷ 7) = 52 weeks
  4. Remaining days = 365 mod 7 = 1 day
  5. Months (approximate) = floor(365 ÷ 30.4375) = 11 months (since 30.4375 × 12 = 365.25, so 365 ÷ 30.4375 ≈ 11.99, floor gives 11)

So the result is: 365 days, which is 52 weeks and 1 day, or approximately 11 months and 29 days (if you want the remainder in days, 365 – 11×30.4375 ≈ 365 – 334.8125 = 30.1875 days). The calculator shows 11 months (with the remainder not shown by default).

When to Use This Calculation

You might need the exact number of days between two dates for:

  • Project deadlines – how many working days (or total days) until a deliverable is due.
  • Age calculation – days since a birthdate, often converted to years, months, and days.
  • Billing cycles – determining the length of a service period.
  • Event planning – counting down to a wedding, vacation, or product launch.
  • Historical research – the time span between two historical events.

The result is a plain number of days, which you can then convert to weeks, months, or years depending on your context. For most practical purposes, the day count is the most precise and unambiguous measure.

How to Read the Result

The primary output is the total number of days. That number is exact—it accounts for leap years and varying month lengths. The weeks and months outputs are conversions:

  • Weeks and days – e.g., 52 weeks and 1 day. This is useful for planning in weekly chunks.
  • Months – an approximate value based on the average month length. For exact months, you would count calendar months, which can vary from 28 to 31 days. For instance, from January 31 to February 28 is 28 days, but that’s “1 monthâ€� in calendar terms, even though it’s less than the average month.

If you need to know “how many full months and remaining days,� you can compute that manually: count the number of month boundaries crossed, then count the remaining days. The calculator’s month output is a good approximation for rough estimates.

Common Mistakes and Pitfalls

People often make these errors when calculating date differences:

  • Including both endpoints – If you count both the start and end dates, you get one extra day. The standard “days betweenâ€� excludes the start date and includes the end date. For example, from Monday to Wednesday is 2 days, not 3.
  • Forgetting leap years – February 29 adds an extra day every four years (with century exceptions). If your span crosses a leap day, the day count increases by one.
  • Using 30 days for every month – That gives a rough estimate but fails for spans that include February or months with 31 days.
  • Time-of-day confusion – If you enter dates with times, the difference can be fractional days. This calculator uses dates only, so the result is a whole number.
  • Timezone issues – When calculating across time zones, the date boundary can shift. Stick to calendar dates, not instants.

Limits of the Formula

The subtraction method gives an exact day count for any two dates in the Gregorian calendar, which is the standard civil calendar in most of the world. However, it does not account for:

  • Business days – The result includes weekends and holidays. If you need working days, you must filter out Saturdays, Sundays, and public holidays separately.
  • Calendar months – The month output is an average, not the actual number of month boundaries. For example, from January 15 to March 15 is 2 months (59 or 60 days), but the average-based calculation would give roughly 1.94 months.
  • Historical calendar changes – Before 1582 (or later in some countries), the Julian calendar was used. This calculator assumes the Gregorian calendar.
  • Time zones and daylight saving – The day count is based on calendar dates, not elapsed time. A day with a time change is still one calendar day.

For most personal, educational, and business uses, the day count is sufficient. For legal contracts or scientific work, you may need to define precisely what “between� means (inclusive/exclusive) and whether to use calendar days or business days.

Frequently Asked Questions

How do I calculate the number of days between two dates manually?

You can count the days in each month between the start and end dates, adjusting for leap years. For example, from March 10 to April 20: March has 31 days, so from March 10 to March 31 is 21 days, plus 20 days in April = 41 days. Alternatively, use the formula: total days = (end date serial number) – (start date serial number).

What is the difference between “days between� and “days including both dates�?

“Days between� typically excludes the start date and includes the end date, so Monday to Wednesday is 2 days. If you include both, it’s 3 days. Always check which convention you need—for example, a rental agreement might say “from the 1st to the 5th� meaning 4 nights, but some people count it as 5 days.

Why does the calculator show 11 months for a full year?

Because it uses the average month length of 30.4375 days. A full year (365 days) divided by that average gives 11.99, so the floor is 11. To get 12 months, you need to count calendar months, not average months. The calculator’s month output is a rough conversion, not an exact calendar month count.

How do I calculate the number of weeks between two dates?

Divide the total days by 7 and take the floor for full weeks. The remainder is the extra days. For example, 45 days ÷ 7 = 6 weeks and 3 days. Some people round to the nearest week, but for planning, it’s usually better to keep the remainder.

Does the calculator include the end date in the count?

No, it follows the standard convention: the difference is the number of days from the start date to the end date, not including the start date. So from Jan 1 to Jan 2 is 1 day. If you need to include both dates, add 1 to the result.

What if the start date is after the end date?

The calculator will return a negative number of days. That’s mathematically correct, but for most uses you’ll want the absolute value. If you need a positive count, swap the dates or take the absolute value of the result.

Related

Formula used
in start | Start date | - | 2024-01-01 | 0
in end | End date | - | 2024-12-31 | 0
out days | Total days | days | end - start | 0
out weeks | Weeks and days | - | floor(days / 7) | 0
out rem_days | Remaining days | days | days % 7 | 0
out months | Months and days | - | floor(days / 30.4375) | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.