ToolBook
Support us on Ko-fi
Help us keep this free, forever

Date Calculator

How to use the Date Calculator

Two modes: find the difference between any two dates, or add and subtract a duration from a date.

  1. Select a calculation mode

    Choose "Days between dates" to find the gap between two calendar dates, or "Add / subtract" to compute a result date that is N days, weeks, months, or years away from a starting date.

  2. Enter the start and end dates

    Type or pick dates from the calendar inputs. The tool prefills today as the start date; change either field to any past or future date.

  3. Review the day count and calendar breakdown

    The total days, weeks, and calendar breakdown (years, months, days) appear instantly alongside the day of the week for each date. Toggle "Include end date" if you need the inclusive count.

  4. Switch to Add / subtract for date offset

    In offset mode, enter a base date, pick a unit (days, weeks, months, or years), and type any positive or negative number. The result date and its weekday name appear immediately.

Frequently asked questions

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

Switch to "Days between dates" mode. Enter a start date and end date — the tool shows the total number of days, the breakdown in weeks and remaining days, and the calendar-accurate breakdown in years, months, and days. It also tells you whether the end date is in the past or future.

How many days until a future event?

In "Days between dates" mode, set today as the start date and your event date as the end date. The tool will show the total days remaining, the weeks and days breakdown, and flag the direction as "Future". This works for countdowns to birthdays, deadlines, exam dates, or travel.

How many days since a past date?

Enter the past date as the start and today as the end in "Days between dates" mode. The tool calculates the exact number of calendar days elapsed, along with the full years, months, and days breakdown. The direction will show as "Past".

What does the "Include end date" option do?

By default, the date difference calculator counts days exclusively: from January 1 to January 5 is 4 days. Turning on "Include end date" adds one day to the count, making it 5 — useful when you need to count all the days a period covers, such as a hotel stay or a leave application.

What does "calendar months" mean in the breakdown?

Calendar months account for the fact that months have different lengths. The tool counts full months from the start date — for example, January 15 to March 10 is 1 full month and 23 days (not exactly 54 divided by 30). This mirrors how EMI tenures, lease periods, and age are conventionally stated.

How do I add or subtract days from a date?

Switch to "Add / subtract" mode. Enter the base date, choose a unit (days, weeks, months, or years), and enter the number to add. Use a negative number to subtract. The result date, the day of the week it falls on, and the total days shifted are shown instantly.

What day of the week will a date be?

Both modes display the day of the week alongside each date. In "Days between" mode, the weekday name appears next to the start and end date inputs as soon as you select a date. In "Add / subtract" mode, the weekday for the result date is shown in the output card.

Does the calculator account for leap years?

Yes. The total-days count uses exact millisecond arithmetic, so February 29 is handled correctly. The calendar breakdown also uses native Date arithmetic, which respects leap years — adding one year to 2024-02-29 gives 2025-02-28.

Can I calculate business days (excluding weekends)?

Not yet — this tool shows calendar days only. Business-day calculation also needs to account for public holidays, which vary by country and year. That will be a separate tool.

Date arithmetic: why counting days is harder than it looks

Why calendar months aren't equal, how leap years affect date math, and when you need exact day counts versus calendar-aware differences.

Why counting days is harder than subtraction

The obvious way to find the gap between two dates is to subtract one from the other. In software, that works perfectly — dates stored as Unix timestamps are just integers, and the difference divided by 86,400 gives you days. This tool's "total days" figure uses exactly that: millisecond arithmetic, then divided and rounded.

But "how old am I in years and months?" requires calendar-aware arithmetic, and that's where it gets complicated.

The calendar-month problem

Not all months have the same number of days. January has 31, February has 28 (or 29), and so on. This means "one month from January 31" has no direct answer — there is no February 31. JavaScript's Date.setMonth() handles this by rolling over: adding one month to January 31 gives March 3 (or March 2 in leap years). Most people would expect February 28 instead, so the tool explicitly handles the end-of-month edge case.

The breakdown of years, months, and days you see in this tool is computed the same way a person would count: "how many full years fit, then how many full months remain, then how many spare days?" This matches how age, lease periods, and loan tenures are conventionally stated.

Leap years and date offsets

When you add one year to a date, most of the time it's simple: 2024-03-15 → 2025-03-15. But 2024-02-29 → 2025-02-29 doesn't exist, so the result becomes 2025-02-28. JavaScript's Date.setFullYear() handles this automatically, which is why the "add/subtract" mode in this tool handles leap year boundaries correctly without special-case code.

The total-days count between 2024-01-01 and 2025-01-01 is 366, not 365, because 2024 is a leap year. Millisecond arithmetic handles this correctly.

Business days vs calendar days

This tool counts calendar days only. For business-day calculations, you'd also need to exclude weekends and public holidays. Public holidays vary by country and even by state — a genuine business-day counter needs a database of holidays, which this tool doesn't include. If you need business days, the approach is: calculate calendar days, then subtract weekends (floor(days/7) × 2 + adjustments for partial weeks), then manually subtract holidays in the range.

Practical uses

The "days between dates" mode is useful for lease expiry, contract duration, age milestones, countdown timers, and interest calculations on short-term lending. The "add/subtract" mode is useful for deadline arithmetic — "90 days from today", "6 months from contract date", "2 years before expiry".