📅 Date Calculator
Find the days, weeks, weekdays and exact years/months/days between two dates, or add or subtract days, weeks, months or years from any date.
What Date Calculator Does
Two different questions get asked under "date calculator," and the top results on the term answer them on two separate pages: how far apart are two dates, and what date is a given number of days, weeks, months or years from today. Both live here as two modes of one tool, because the underlying arithmetic — and the two ways it commonly goes wrong — is the same either way.
The years/months/days breakdown between two dates uses the identical method as this site's age calculator: whole years, then whole months, then the leftover days, borrowing from the month before the later date when the day of the month has not yet come round. The two tools are kept deliberately consistent — asking either one about the same two dates gives the same answer, which is not something you can assume across two calculators from different sites, since the same interval genuinely has more than one defensible month-and-day reading.
Adding or subtracting months or years has its own, separate failure mode, and it is the more common bug of the two. Naive date arithmetic — add one to the month number, ask JavaScript for the result — rolls 31 January plus one month into 3 March, because February only has 28 or 29 days and the extra ones spill into the following month. This tool clamps to the last real day of the target month instead: 31 January plus one month is 28 February, or 29 in a leap year, and stays in February.
How to Use Date Calculator
- Choose "Days Between Two Dates" or "Add / Subtract From a Date"
- Enter the date(s) — for the second mode, also the amount and unit to add or subtract
- Read the total days, the years/months/days breakdown, and the weekday count
Formula Used by Date Calculator
Total days between two dates
totalDays = round((later − earlier) ÷ 86,400,000 ms)
- later, earlier
- Both dates constructed as local calendar midnights, never parsed as UTC and read as local — the mismatch that shifts every date by one day for anyone west of UTC
Worked example
1 January 2024 to 1 March 2024 — spans the leap day
- January has 31 days, so 1 Jan to 1 Feb is 31 days
- February 2024 has 29 days (2024 ÷ 4 = 506, not a century year), so 1 Feb to 1 Mar is 29 days
- 31 + 29 = 60
Result: 60 days — one more than the same span in a non-leap year, entirely because the actual calendar was used rather than a fixed 365-day-year approximation
Adding a month without overshooting
result day = min(source day, days in target month)
Worked example
31 January 2025 plus one month
- Target month is February 2025
- February 2025 has 28 days (2025 is not a leap year)
- The source day, 31, is clamped to 28
Result: 28 February 2025 — not 3 March, which is what new Date(y, m+1, 31) actually returns, since day 31 does not exist in February and JavaScript rolls the overflow into March
The years/months/days breakdown
Count whole years → whole months → remaining days, borrowing when needed
- Borrowing
- If the day of the month has not come round yet, take the days from the month before the later date
Worked example
29 February 2024 to 1 March 2025
- Whole years: 2024 to 2025 is 1
- Months: March (2) − February (1) = 1
- Days: 1 − 29 = −28, so borrow: months → 0, days += 28 (February 2025 has 28 days) → 0
Result: 1 year, 0 months, 0 days — the same figure age-calculator would give for the same two dates, and the reason it is 0 rather than 1 day is explained in Limitations below
Days in each month
February is the only variable one — 28 days in a common year, 29 in a leap year.
| Month | Days |
|---|---|
| January | 31 |
| February | 28 (29 in a leap year) |
| March | 31 |
| April | 30 |
| May | 31 |
| June | 30 |
| July | 31 |
| August | 31 |
| September | 30 |
| October | 31 |
| November | 30 |
| December | 31 |
Leap years, 2024–2032
The Gregorian rule: divisible by 4, except century years unless also divisible by 400. None of these are century years, so the plain divisible-by-4 test applies to all of them.
| Year | Leap year? |
|---|---|
| 2024 | Yes |
| 2025 | No |
| 2026 | No |
| 2027 | No |
| 2028 | Yes |
| 2029 | No |
| 2030 | No |
| 2031 | No |
| 2032 | Yes |
How to Read Your Result
Weekdays vs. business days
The weekday count on this page is Monday through Friday only. It is not a business-day count in the payroll or legal sense, because it has no holiday calendar for any country — a range that includes a public holiday will overcount actual working days by however many holidays fall inside it.
Why "days between" and "add to a date" share a page
They are the same underlying operation run in opposite directions: one measures the gap between two known dates, the other starts from one date and a gap and asks for the other endpoint. Splitting them across two pages, which most competitors do, means maintaining the same date math twice.
Why the century-year exception rarely comes up
The table above never needs the divisible-by-400 exception, because none of 2024 through 2032 are century years — that rule only bites in years like 1900 (not a leap year) and 2000 (a leap year, since 2000 ÷ 400 is exact). It will not matter again for this tool's users until 2100.
Limitations & Accuracy Notes
- The years/months/days breakdown has a genuine, unresolved ambiguity around a 29 February start date landing on a non-leap end date, and this tool resolves it the same way age-calculator does rather than picking a "more correct" answer: walking forward from 29 Feb 2024 one full year lands on 28 Feb 2025 (since 2025 has no 29th), and one more day reaches 1 March — which reads as 1 year and 1 day by that logic, not the 1 year and 0 days this tool reports. Both are defensible; this tool is internally consistent with its sibling calculator rather than "correct" by some external standard nobody actually agrees on.
- No time zone or time-of-day handling. Both dates are treated as local calendar dates with no clock time, so this tool cannot answer "how many hours until 3pm Tuesday" — only whole-day questions.
- No holiday calendar. The weekday/weekend split has no notion of public holidays in any country.
- The "Total hours" figure is a pure multiplication of days by 24 and does not account for a clock changing for daylight saving time inside the range — a range crossing a DST transition is not exactly N × 24 hours in real elapsed time, only in calendar hours.
Frequently Asked Questions
How is the years/months/days breakdown calculated?
Does this account for leap years?
What happens if I add a month to the 31st of a month?
What counts as a weekday here?
Does the order I enter the two dates matter?
References & Further Reading
- timeanddate.com — Leap Year Rules — States the three-part Gregorian leap-year rule and confirms which nearby years are leap years, used to verify the table above