Date Calculator

Use this date calculator to find days between dates, add or subtract time, or count business days with clear start and end date rules.

Find how many days are between two dates.
Move forward or backward from one date.
Count workdays, with weekends and optional holidays removed.
Advanced options

Boundary counting (range ends)

If checked, the start date is counted when it qualifies for the chosen mode.
If checked, the end date is included in the total when it qualifies for the chosen mode.

Business-day rules

Turn this off if you only want weekend-based counting.

Display

Did we solve your problem today?

How to use our Date Calculator

  1. Choose What do you want to calculate: Days between dates, Add or subtract time, or Business days.
  2. Enter the needed date fields: Start date and End date for ranges, or Base date plus Operation, Years, Months, Weeks, and Days for moving forward or backward.
  3. If you need more control, open Advanced options and set Count start date, Count end date, Weekend pattern, and optional Custom holiday dates.
  4. Click Calculate, then read Main result first and use What was counted to see exactly whether the start date, end date, weekends, and holidays were included.
  5. Do a quick sanity check: if both dates are the same, or if you choose No weekends with no holidays, make sure the result matches the simple counting rule you expected.

Definitions

Main result: The main answer for the selected mode: total counted days, a resulting date, or total business days.

Calendar days counted: All counted dates in the range under your boundary rule before removing weekends or holidays.

Business days counted: Counted dates that are not weekends and, if chosen, not custom holidays.

Count start date: If turned on, the Start date is included when it qualifies for the chosen mode.

Count end date: If turned on, the End date is included when it qualifies for the chosen mode.

Weekend pattern: The weekdays treated as weekends in Business days mode.

Custom holiday dates: Extra dates you want the calculator to skip as non-business days, entered one per line as YYYY-MM-DD.

Years, months, and days: A calendar-style gap that borrows across real month lengths instead of using an average month.

Weeks and days: The total day count rewritten as full weeks plus leftover days.

What was counted: A plain-language note that explains the exact counting rule used for your result.


Common mistakes and quick fixes

Mistake: Entering End date earlier than Start date and expecting a positive Main result.
Fix: Swap Start date and End date if you want a forward count, or keep them as entered if you want a signed result.

Mistake: Typing a minus sign into Days, Weeks, Months, or Years in Add or subtract time mode.
Fix: Keep Years, Months, Weeks, and Days non-negative and use Operation to choose Add or Subtract.

Mistake: Forgetting that Count start date and Count end date change Calendar days counted and Business days counted.
Fix: Check the What was counted note after calculating so you know exactly which boundary dates were included.

Mistake: Using Weekend pattern that does not match your schedule in Business days mode.
Fix: Set Weekend pattern to the correct option before trusting Business days counted.

Mistake: Pasting Custom holiday dates in the wrong format, such as 7/3/2026.
Fix: Enter each line in Custom holiday dates as YYYY-MM-DD, like 2026-07-03.

Mistake: Expecting Treat custom holidays as non-business days to work when Custom holiday dates is blank.
Fix: Add at least one valid date to Custom holiday dates, or leave the checkbox on with no effect.


Limitations & Key Assumptions / Boundary Conditions

  • Date ranges use whole dates only, not time of day.
  • Boundary settings matter: changing Count start date or Count end date can change a result by 1 day.
  • In Add or subtract time mode, months and years use calendar math, so month-end dates can shift to the last valid day of a shorter month.
  • Business days results depend entirely on the selected Weekend pattern and any Custom holiday dates you enter.
  • Only custom holidays entered by you are excluded. The calculator does not automatically load country or company holiday calendars.
  • Holiday lines must be valid YYYY-MM-DD dates. Invalid lines should be corrected before trusting the result.
  • If End date is earlier than Start date, the calculator may show a signed result to reflect direction.

Methodology

How the calculator works

This tool handles three common date tasks: finding the gap between two dates, moving forward or backward from a base date, and counting business days [1]. To keep whole-day counts stable, date differences should be computed using normalized dates and 86,400,000 milliseconds per day.

1) Days between dates

calendar_diff = floor((normalized_end - normalized_start) / 86400000)

counted_days = calendar_diff + (include_end ? 1 : 0) - (include_start ? 0 : 1)

The first formula gets the raw whole-day gap from Start date to End date. The second formula adjusts that gap based on whether Count start date and Count end date are on. This is why the same two dates can produce different answers depending on your boundary choices.

Example: Start date 2026-03-01 and End date 2026-03-10 have a raw gap of 9 days. If Count start date is off and Count end date is on, the total is 10 counted days. If both are off, the total is 9.

2) Add or subtract time

day_offset = weeks * 7 + days

target_date = shift_days(shift_months(shift_years(base_date, s*years), s*months), s*day_offset)

Here, s is +1 for Add and -1 for Subtract. Years and months are applied as calendar units first, then weeks and days are applied as day counts. This avoids pretending every month has the same length.

Mini-example: Base date 2026-03-18, Operation Subtract, Weeks 2, Days 3 gives a day offset of 17 days, so the Resulting date is 2026-03-01.

3) Business days

business_days = count(d in range where not is_weekend(d) and (use_holidays implies not is_holiday(d)))

The calculator checks each counted date in the range. A date is included only if it is not part of the chosen Weekend pattern and, when Treat custom holidays as non-business days is on, not listed in Custom holiday dates. The supporting Calendar days counted value shows the full counted range before those removals.

Mini-example: From 2026-07-01 to 2026-07-07 with Count start date off, Count end date on, Saturday and Sunday as weekends, and 2026-07-03 as a custom holiday, the counted range has 7 calendar days and 4 business days.

Breakdowns shown in results

full_weeks = floor(abs(total_days) / 7)

leftover_days = abs(total_days) mod 7

ymd = borrow_based_calendar_difference(start_date, adjusted_end_date)

Weeks and days is a simple rewrite of the total into full weeks plus extra days. Years, months, and days is different: it uses real calendar borrowing across months of different lengths, so it matches how people usually talk about date gaps.

Assumptions that can change results

Results can differ from your expectation if you switch boundary settings, choose a different Weekend pattern, or enter custom holidays. Month-end dates also need special handling. For example, moving one month from a date near the end of a long month may land on the last valid day of a shorter month, which is why the calculator may show a short warning note when an adjustment happens.


Sources