Days Between Dates Calculator
Calculate the exact number of days between any two dates.
Select Two Dates
Select two dates to calculate the days between them
What Is a Days Between Dates Calculator?
A days between dates calculator counts the exact number of calendar days separating any two dates. Enter a start date and an end date, and the calculator returns the precise day count — whether the two dates are days, months, years, or decades apart. This fundamental date arithmetic operation underlies dozens of practical calculations: loan maturity periods, insurance coverage windows, contract durations, age verification, and deadline tracking all require knowing exactly how many days separate two specific dates.
The calculation is straightforward for dates within the same month (just subtract the day numbers), but becomes complex when crossing month boundaries (months have 28-31 days), year boundaries (years have 365 or 366 days), and leap years (February has 29 days instead of 28). This calculator handles all these edge cases automatically using calendar-aware date arithmetic.
The result is displayed in multiple units for additional context: the total days count, the equivalent in complete weeks and remaining days, the equivalent in approximate months, and the total in hours and minutes. These alternative representations make the same interval more meaningful for different purposes — scheduling, financial calculations, and historical analysis each benefit from different unit perspectives on the same date gap.
Days Between Dates Formula
The most precise method converts both dates to a universal numeric representation (milliseconds since Unix epoch), subtracts them, and converts the result to days.
Days Between Dates
Where:
- Date1, Date2= The two dates to compare, as Date objects with times set to midnight
- getTime()= Returns milliseconds since January 1, 1970 UTC (Unix timestamp)
- 86,400,000= Number of milliseconds in one day: 24 × 60 × 60 × 1000
- |…|= Absolute value — result is always positive regardless of which date comes first
Inclusive vs Exclusive Day Counting
When counting days between two dates, the result depends on whether you include the start date, the end date, both, or neither in the count. This calculator uses the exclusive method — it counts the days in the gap between the two dates, not including either boundary date. From January 1 to January 31, the gap is 30 days (not 31). This matches the mathematical date difference (31 - 1 = 30) and is the standard in computing.
However, many legal and everyday contexts are inclusive — they count both boundary days. A stay at a hotel "from January 1 to January 3" covers 3 nights but 2 nights... actually 2 nights (January 1 and January 2), checking out January 3. Or is it 3 nights? The convention varies. For employee tenure ("from January 1 through January 31"), both days are working days, so the count is 31, requiring adding 1 to the exclusive mathematical difference. Always clarify the counting convention for your specific use case.
Practical Uses for Days Between Dates
Financial applications: simple interest on loans and deposits is calculated as principal × rate × (days/365). Interest accrues daily, and knowing the exact number of days from loan origination to the current date gives the precise interest owed. The US Treasury uses "actual/actual" day counting for bonds, which requires counting the exact days between settlement and maturity — a task this calculator handles precisely.
Legal applications: statutes of limitations are measured in calendar days. A 3-year (1,095-day) limit on a civil claim filed on May 15, 2025 means the latest qualifying event date is May 15, 2022. Counting backwards 1,095 days from the filing date confirms whether the claim is timely. Court systems also use day counts for response deadlines, appeal windows, and procedural requirements.
Common Day Count Reference Points
Several day counts have special significance in law, finance, and medicine: 30 days is a common short-term notice or return window. 60 days is used for insurance grace periods and many regulatory response deadlines. 90 days is a common probationary period and project milestone horizon. 180 days is roughly 6 months and appears in visa restrictions, financial waiting periods, and employment eligibility rules. 365 days is a year (leap years have 366). 730 days is 2 years. 1,095 days is 3 years. 1,826 days is 5 years (or 1,827 in leap-year-inclusive periods).
Worked Examples
Loan Interest Period
Problem:
A loan was originated on March 15, 2025. How many days have elapsed by June 30, 2025?
Solution Steps:
- 1March 15 to March 31: 31 - 15 = 16 days
- 2April: 30 days; May: 31 days; June 1-30: 30 days
- 3Total: 16 + 30 + 31 + 30 = 107 days
- 4Use this for daily interest accrual: principal × annual rate × 107/365
Result:
107 days have elapsed from March 15 to June 30, 2025.
Statute of Limitations Check
Problem:
A 2-year statute of limitations applies to a claim. Was an incident on July 4, 2023 within the limitation period if the lawsuit was filed on July 3, 2025?
Solution Steps:
- 1Days between July 4, 2023 and July 3, 2025
- 2July 4, 2023 to July 4, 2025 = 2 years = 730 days (2024 is a leap year: 365 + 366 = 731)
- 3Wait: 2023 to 2024 = 365 days; 2024 to 2025 = 366 days (2024 leap year) — July 4, 2023 to July 4, 2025 = 731 days
- 4July 3, 2025 is 730 days from July 4, 2023 — within the 730-day 2-year limit
Result:
730 days elapsed from July 4, 2023 to July 3, 2025. If the 2-year (730-day) statute of limitations is non-inclusive of the boundary, the filing on July 3 is timely.
Vacation Duration
Problem:
A vacation runs from December 20, 2025 to January 4, 2026. How many days is that?
Solution Steps:
- 1December 20 to December 31: 31 - 20 = 11 days
- 2January 1 to January 4: 4 days
- 3Total gap: 11 + 4 = 15 days
- 4The vacation spans 15 days between the two dates
Result:
There are 15 days between December 20, 2025 and January 4, 2026 (or 16 days if counting both boundary dates inclusively).
Tips & Best Practices
- ✓For interest calculations, use the exact day count (not approximate months × 30) to match the 'actual/actual' day count method used by most lenders.
- ✓Always verify whether your legal deadline requires 'days' meaning calendar days or business days — the distinction matters significantly around weekends.
- ✓When counting days that cross a year boundary, remember that leap years (2024, 2028) add one extra day in February.
- ✓For project planning, count the days between today and the deadline to establish your remaining time budget.
- ✓The weeks-and-remaining-days output helps scheduling: '42 weeks and 3 days' maps directly to sprint and weekly planning cycles.
- ✓For subscription periods, counting days (not months) eliminates the ambiguity of 'monthly' intervals near month-end dates.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-06
Help us improve!
How would you rate the Days Between Dates Calculator?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Standard Mathematical References
by Various