Skip to content
Quasar Tools Logo

Days Between Dates Calculator

Calculate the exact number of days between two dates, find how many days until a future event, or count how many days have passed since a past date — free online calculator.

DH
Tutorials & How-Tos11 min read2,650 words

Counting the days between two dates sounds simple — until month boundaries, leap years, and inclusive versus exclusive counting all conspire to give you the wrong number. Whether you need to know how many days until a deadline, how many days have passed since a milestone, or the exact duration between two calendar dates, this guide explains every method clearly and shows you the fastest way to get an accurate result.

365Days in a standard year366 in a leap year
30.44Average days per monthGregorian calendar
< 1sTime to calculateUsing an online tool

How date duration is calculated

Every date in a modern calendar system can be represented as a single integer — the number of days elapsed since a fixed reference point called an epoch. JavaScript and most programming languages use January 1, 1970 (Unix epoch) as the reference. Excel and Google Sheets use January 1, 1900. The actual reference does not matter for day counting: subtract one date's integer from another and you get the exact number of calendar days between them.

The calendar complexity behind simple subtraction

Months have 28, 29, 30, or 31 days. Leap years add a day to February every four years, with century-year exceptions. This means you cannot reliably calculate a multi-month date span by multiplying months by 30. A span from January 15 to March 15 is 59 days in a non-leap year and 60 days in a leap year — a difference that matters for contract deadlines, subscription billing, and project timelines.

Inclusive vs exclusive counting

Most calculators — including the Date Difference Calculator on Quasar Tools — use exclusive counting: the span from January 1 to January 3 is 2 days (neither endpoint is counted as part of the interval). Legal and billing contexts sometimes use inclusive counting, where both endpoints are counted, making the same span 3 days. Always confirm which convention applies before relying on a day count for anything contractually significant.

  • Exclusive (default): January 1 → January 3 = 2 days. Most calculators and programming languages.
  • Start-inclusive: January 1 → January 3 = 3 days. Common in billing ("starting from day 1").
  • End-inclusive: January 1 → January 3 = 3 days. Common in legal ("on or before day X").
  • Fully inclusive (both endpoints): January 1 → January 3 = 3 days. Used in some HR and education contexts.

Note

When a contract says "within 30 days," confirm whether the counting starts on the day the agreement is signed (inclusive) or the day after (exclusive). The difference of one day can affect enforceability in some jurisdictions.

How many days until an event

"How many days until" is the most common date duration query. It answers questions like: how many days until my project deadline, how many days until my subscription renews, or how many days until a birthday. The calculation is always today's date subtracted from the future target date — the result tells you the runway you have remaining.

Knowing the exact days remaining turns a vague deadline into a concrete number you can plan around.

Practical planning principle

Quick worked examples

If today is June 11 and your project deadline is September 1, the calculation crosses two full months of varying lengths. June has 30 days, July has 31, and August has 31. From June 11 to September 1: 19 days remaining in June + 31 in July + 31 in August + 1 in September = 82 days. Doing this manually is error-prone across month and year boundaries. The Days Until / Days Since Calculator gives you this result instantly and updates every day automatically.

Saving recurring countdowns

Many date-duration questions recur regularly — a contract renewal date, an annual review, a product launch anniversary. The Days Until / Days Since Calculator on Quasar Tools lets you save specific dates to a personal dashboard so you can check the live running count without re-entering dates each time. This is more reliable than mental arithmetic and more persistent than a quick Google search.

Tip

For project planning, save your key milestone dates in the Days Until calculator at the start of a project. Check the running countdown each week — it keeps timelines visible without opening a full project management tool.

Days Until / Days Since Calculator

Count the exact days until any future event or since any past milestone — with a saveable dashboard so recurring countdowns update automatically.

Open tool

How many days since a date

"How many days since" calculates the elapsed duration from a past date to today. This comes up in SLA monitoring (how many days since a ticket was opened), subscription management (how many days since sign-up), health tracking (how many days since a procedure), and personal milestones (how many days since a career change). In each case you are measuring the running age of something that started on a known date.

Real use cases for days-since counting

  • SLA and support: Days since a bug was reported or a ticket was opened — to flag SLA breaches.
  • Finance: Days since a payment was due — to calculate overdue interest or follow-up cadence.
  • Health and fitness: Days since starting a diet, training programme, or medication course.
  • Legal: Days since a notice was served — to track statutory response deadlines.
  • Product: Days since a feature was shipped — to evaluate adoption velocity.
  • Personal: Days since a wedding, graduation, or move — for anniversary planning.

The key distinction between "days since" and "days until" is direction: days since counts forward from a fixed past point, while days until counts backward from a fixed future point. Both use the same underlying calculation — the absolute difference between two dates — but the framing changes how you use the result.

Note

For automated systems that need to compute "days since" programmatically, the JavaScript expression `Math.floor((Date.now() - new Date('YYYY-MM-DD').getTime()) / 86400000)` gives the exclusive day count from a past date to today. Verify edge cases around midnight in the user's local timezone.

Using the Days Between Dates calculator

The Date Difference Calculator and Days Until / Days Since Calculator on Quasar Tools cover all three query types — days between two specific dates, days until a future event, and days since a past event. Both tools run entirely in your browser with no login, no upload, and no data sent to a server.

1

Open the Days Until / Days Since Calculator

Go to /tools/math/calculators/days-until-days-since-calculator. No signup required. The calculator works in any modern browser on desktop or mobile.

2

Enter your start date

Type or select your start date using the date picker. For a "days since" query, the start date is the past event. For a "days until" query, the start date is today (pre-filled automatically). For a "days between" query, it is the earlier of your two dates.

3

Enter your end date

Select your end date. For "days until" this is the future target date — a deadline, birthday, or renewal. For "days between" it is the second date in your span. The calculator accepts any dates from January 1, 1000 through December 31, 9999.

4

Read the full breakdown

The result shows the total day count and a complete decomposition into weeks, months, and years. Use whichever unit fits your context — total days for programming or scheduling, weeks for sprint planning, months for financial forecasting, and years for contract or lease duration.

5

Save recurring countdowns

Use the save feature to bookmark dates you check regularly. The saved dashboard updates the live running count each day — useful for tracking project milestones, subscription renewals, or contract end dates without re-entering dates.

Date Difference Calculator

Calculate the precise difference between any two dates in days, weeks, months, and years — with a full calendar-accurate breakdown.

Open tool

Converting days to weeks, months, and years

A raw day count is exact but not always the most useful unit for communication. Telling a stakeholder a project has "82 days remaining" is less intuitive than "11 weeks and 5 days" or "just under 3 months." Here is how to convert accurately across each unit.

UnitFormulaNotes
WeeksDays ÷ 7 (integer + remainder)Exact — 7 days is always 1 week
Approximate monthsDays ÷ 30.44Average Gregorian month length
Exact monthsCalendar walk from start to endAccounts for varying month lengths
YearsDays ÷ 365.25Approximation including leap years
Exact years + monthsCalendar decompositionUsed by Date Difference Calculator

Why dividing by 30 is inaccurate

The most common mistake in manual date arithmetic is dividing by 30 to get months. Because February has 28 or 29 days and months range from 28 to 31 days, the actual average is 30.44 days per month. Over a 6-month span the error from using 30 instead of 30.44 is about 2.6 days — enough to miscalculate a billing cycle or a lease renewal date. Use the Date Difference Calculator for exact month counts that walk the calendar rather than divide.

Leap years and date spans crossing February

Any date range that includes February 29 in a leap year contains one extra day compared to the same range in a non-leap year. A span from December 1, 2023 to March 1, 2024 is 91 days (2024 is a leap year: 31 + 29 + 29 + 1 = 91). The same span in 2023 would be 90 days. Online calculators handle this automatically; manual calculations need an explicit leap-year check for every year the span crosses.

Warning

Never hardcode "365 days = 1 year" in billing, legal, or scheduling code. Always calculate from actual calendar dates to account for leap years. A one-year SaaS subscription starting on March 1, 2024 ends on March 1, 2025 — that span is 366 days, not 365, because 2024 is a leap year.

Common use cases by role

Date duration questions arise across nearly every professional domain. The calculation is the same regardless of context, but the unit you care about and the precision required differ. Here is how different roles use days-between calculations in practice.

Project managers and developers

Sprint planning, milestone tracking, and deadline pressure all require knowing the exact days remaining. Developers tracking a release date want total days; project managers communicating to stakeholders prefer weeks or sprints. The Days Until calculator covers both with its multi-unit breakdown. For task-level scheduling that needs to exclude weekends and holidays, pair it with the Business Days Calculator.

HR and payroll professionals

Probation periods, notice periods, and leave accrual all depend on accurate calendar-day counts. An employee serving a 90-day probation period that starts on February 1 in a leap year ends on May 1 (91 calendar days). HR teams relying on "3 months = 90 days" will miscalculate end dates in leap years. The Date Difference Calculator produces the correct calendar-accurate end date every time.

Contract durations, statutory deadlines, payment terms, and interest accrual periods all depend on exact day counts. Legal contexts often require inclusive day counting (the day of service is day 1). Finance contexts typically use actual/actual day-count conventions for bond interest. Always confirm the day-count convention before applying a calculator result to a binding calculation — add 1 to the exclusive count for inclusive requirements.

Everyday personal use

  • Birthdays and anniversaries: How many days until someone's 30th birthday or a wedding anniversary.
  • Travel planning: How many days until a flight, visa expiry, or hotel check-in.
  • Health tracking: How many days since starting a fitness challenge, diet, or medication.
  • Event countdowns: How many days until a concert, graduation, exam, or product launch.

Tip

For age-related date calculations — how old someone is on a specific date, or when someone turns a specific age — the [Age Calculator](/tools/math/calculators/age-calculator) is more appropriate than a general date difference tool. It handles birth dates, outputs age in years, months, and days, and shows the next birthday countdown.

Edge cases and pitfalls

Most date duration calculations are straightforward, but a handful of edge cases trip up both manual calculations and poorly written tools. Knowing them upfront prevents downstream errors in projects, billing systems, and legal filings.

Same-day calculations

When the start and end date are the same, an exclusive calculator returns 0 days — the span has zero length. An inclusive calculator returns 1. This matters for day-of-service questions: if a contract is signed and executed on the same day, is the duration 0 days (exclusive) or 1 day (inclusive)? The answer depends on the contract's own day-count definition.

Dates crossing daylight saving time

Daylight saving transitions add or remove one hour from a day. If you calculate date spans using millisecond arithmetic (as JavaScript's `Date` object does), a span crossing a DST boundary may be 23 or 25 hours rather than exactly 24 hours, which can shift the day count by 1 depending on how the rounding is handled. Calendar-based calculators that work on date objects rather than timestamps avoid this problem entirely. The Quasar Tools date calculators use local calendar dates, not millisecond timestamps, so DST boundaries do not affect the result.

Historical dates before the Gregorian calendar

The Gregorian calendar was adopted at different times in different countries — the UK adopted it in 1752, Russia in 1918. Historical date calculations before adoption in a given country use the Julian calendar, which differs from the Gregorian by a growing number of days (currently 13 days). For historical research involving pre-adoption dates, use a proleptic Gregorian calendar calculator that applies Gregorian rules retroactively. The Quasar Tools date calculators use the proleptic Gregorian calendar for all dates.

Edge casePotential errorHow to handle it
Same start and end date0 vs 1 dayConfirm inclusive vs exclusive requirement
Crossing Feb 29 (leap year)±1 dayUse a calendar-based calculator
DST transition boundary±1 day (timestamp math)Use calendar dates, not timestamps
Month-end to month-start±1–3 daysWalk calendar, do not multiply by 30
Year boundary (Dec 31 → Jan 1)0 vs 1 dayVerify day-count convention

Warning

In Excel and Google Sheets, the DATEDIF function with "D" gives the exclusive day count. The plain subtraction formula (=B1−A1) also gives the exclusive count. Both return 0 when start equals end. The DAYS function returns the same result. For inclusive counts, add 1 to any of these formulas.

Key takeaways

  • Date duration is calculated by converting dates to sequential day numbers and subtracting — the Date Difference Calculator does this instantly with no manual arithmetic.
  • Exclusive counting (the default in most tools) does not include either endpoint: January 1 → January 3 = 2 days. Add 1 for inclusive counting when contracts or legal deadlines require it.
  • Never use "30 days per month" for multi-month spans — the actual average is 30.44 days, and leap years shift spans crossing February by one day.
  • For working-day counts that exclude weekends and holidays, use the Business Days Calculator rather than a calendar-day calculator.
  • DST transitions and Julian/Gregorian calendar differences can shift results by 1 day — use a calendar-based tool rather than raw timestamp arithmetic.
  • The Days Until / Days Since Calculator lets you save recurring countdowns so you can check a live running day count without re-entering dates each time.
  • For age calculations from a birth date, use the Age Calculator, which outputs the result in years, months, and days with a next-birthday countdown.

Frequently Asked Questions

Subtract the earlier date from the later date. In mathematical terms, convert both dates to a serial day number (the count of days from a fixed epoch like January 1, 1970) and subtract the smaller from the larger. The result is the number of days between them. The Quasar Tools Date Difference Calculator does this automatically — enter your two dates and the result appears instantly with a full breakdown into weeks, months, and years.

For manual calculation, use the formula: Days = (Year2 − Year1) × 365 + adjustment for leap years + (Day2 − Day1). This is tedious for large spans, which is why an online calculator is the practical choice.

Use the Days Until / Days Since Calculator at /tools/math/calculators/days-until-days-since-calculator. Enter today as the start date and your target date as the end date. The calculator returns the exact number of days remaining, broken down into weeks and months.

Alternatively, if you know the approximate number of months, multiply by 30 for a rough estimate. But for any date more than a week away — especially across month boundaries or leap years — use the calculator to avoid off-by-one errors from varying month lengths.

Enter the past date as the start date and today as the end date in the Date Difference Calculator. The result is the exact number of days that have elapsed. This is useful for tracking how long ago an event occurred — a contract start date, a project launch, or a personal milestone.

For recurring tracking (e.g. how many days since you launched a product), use the Days Until / Days Since Calculator save feature to bookmark the date and check the live running count without re-entering anything.

Most date difference calculators — including the Quasar Tools Date Difference Calculator — count the span between the two dates exclusively: neither the start date nor the end date is included in the count. So the distance from January 1 to January 3 is 2 days. If you need an inclusive count (counting both the first and last day), add 1 to the result. This distinction matters in legal and contract contexts where "within 30 days" typically means the end date is day 30, not day 31.

Calendar days count every day including weekends and public holidays — a span of 14 calendar days always contains exactly 14 days regardless of when it falls. Business days (also called working days) count only Monday through Friday, excluding any designated public holidays. A 14-calendar-day span contains 10 business days if it starts on a Monday.

Use the Business Days Calculator at /tools/math/calculators/business-days-calculator when you need working-day counts for project scheduling, legal deadlines, or payroll calculations that exclude non-working days.

The Business Days Calculator on Quasar Tools supports custom holiday exclusion. Tick "include weekends" and add your specific public holidays to the exclusion list. The calculator then counts every calendar day except the holidays you specify. This is useful for industries like finance or healthcare where Saturday may be a working day but specific national holidays are not.

The most common reason is inclusive versus exclusive counting — whether the start and/or end date are counted as part of the span. A secondary cause is timezone handling: if a calculator converts dates to UTC timestamps, midnight boundaries can shift the result by one day for users in UTC-minus timezones. The Quasar Tools Date Difference Calculator works on local calendar dates without timezone conversion, so the result matches what you see on a physical calendar.

Divide the day count by 7 for complete weeks. For months, the calculation is less precise because months have different lengths — an approximate formula is days divided by 30.44 (the average Gregorian month). For an exact breakdown in years, months, and days (e.g. "1 year, 3 months, and 12 days"), use the Date Difference Calculator at /tools/math/calculators/date-difference-calculator, which computes the full decomposition automatically by walking through the calendar rather than dividing a flat day count.

ShareXLinkedIn

Related articles