What this date difference calculator does
This date calculator measures the duration between two calendar dates — whether you need to calculate age difference, project deadlines, tenure, or simply answer “how many days between” two events. Unlike a simple day counter that assumes every month is 30 days, this time between dates tool walks the calendar correctly: real month lengths, correct February days, and leap-year awareness. It gives you two complementary views for every span.
How to use — step by step
- Pick Start Date (A) and End Date (B) — day / month / year. The day menus narrow to valid options (e.g., February shows 28/29 based on the year you choose). End Date defaults to today if you leave it blank.
- Press Calculate Difference. Order doesn’t matter: if A is after B, the tool swaps them internally and shows a note “Dates were swapped to calculate” — so you never get a negative result.
- Swap quickly with the Swap button to flip A and B without re-entering — handy for seeing the same span from the other direction.
- Read both cards: calendar years/months/days plus elapsed totals, with weekdays for both dates. Use Reset to clear and recalculate.
How the difference is calculated (formula)
The same calendar method as the main age calculator is reused for any two dates:
- Normalize order: let
start = earlier date, end = later date. RememberisReversed = (a > b). - Years:
years = end.year - start.year, then borrow if months/days negative. - Months:
months = end.month - start.monthwith borrowing of 12 months. - Days:
days = end.day - start.day; if negative, borrow exact days in the month beforeendviadaysInMonth(prevYear, prevMonth). Leap ruleyear%4===0 && year%100!==0 || year%400===0keeps February correct. - Elapsed totals:
totalDays = floor((endUTC - startUTC)/86400000),weeks = floor(days/7),hours = days×24(and so on). Documented on how age is calculated.
Worked examples
Example 1 — tenure
1 January 2020 → 15 March 2023
- Calendar: 3 years, 2 months, 14 days
- Elapsed: 1,169 days • 167 weeks • 28,056 hours
- Verification: Jan has 31 days, Feb 2023 has 28 — borrowing uses February’s 28 days, so Jan 31 → Feb 28 logic stays correct.
Example 2 — reversed order
End: 10 June 2000, Start: 14 March 2026 (entered backwards)
Result is identical: 25 years, 9 months, 4 days with a note “Dates were swapped to calculate (start was after end).” No negative age, no error — the same span shown in the how-it-works example.
Example 3 — month-end edge
31 January 2020 → 28 February 2020
Not “1 month.” The tool borrows January’s 31 days, yielding 0 years, 0 months, 28 days and 28 elapsed days — correctly handling varying month lengths.
Understanding your inputs & results
- Inputs are calendar dates only — year, month, day. Time-of-day isn’t collected, so elapsed hours assume each calendar day = 24 hours at UTC midnight.
- Calendar years/months/days: the human reading you’d write on forms (“3 years, 2 months, 14 days”).
- Total days / weeks / months: elapsed counts — total months = years×12 + months; weeks = floor(days/7). Handy for project planning and age difference.
- Total hours / minutes / seconds: derived from totalDays × 24/60 — useful for “how many hours between” without timezone shift.
- Weekdays for both dates: shown in the Dates card as “14 March 2026 (Saturday)” to verify you picked the intended dates. UTC is used so the weekday matches the calendar date everywhere.
- Swapped note: appears only when start was after end — reassurance that the duration is absolute.
Tips, assumptions & limitations
- Gregorian calendar only; dates before 1582 still use Gregorian rules (proleptic).
- No time zones: both dates at UTC midnight — if you need hour-level precision across zones, that must be verified separately (see disclaimer).
- Daylight saving ignored: each day counted as 24 hours; a day that was 23 or 25 hours in local time is still one elapsed day here.
- Dates saved locally as
agecalc:date-diff— Reset or browser data deletion clears them (see privacy policy). - Use the right tool: for “how old am I today?” use age calculator; for “when is my next birthday?” use birthday calculator. This page is for any two dates.
Frequently asked questions
How many days between my two dates?
Enter both dates above; the Elapsed duration card shows Total Days exactly. For inclusive counts (including both endpoints) add 1 manually.
Can I calculate age difference between two people?
Yes — enter both birth dates. The calendar result (e.g., 2 years, 3 months, 10 days) is the age gap. For current age of one person on any date, use the age calculator with “Calculate Age At.”
Why not just count total days and divide?
Because months and years aren’t fixed lengths. Feb has 28/29 days; months range 28–31. Dividing total days loses that — walking the calendar keeps human-readable years/months/days accurate. See why not divide by 365.
Related tools
All three calculators share the same verified calendar math: