Decision tools built for clarity

Date Difference Calculator

Find the calendar difference between dates, or add and subtract a day count.

Enter the required values, select the applicable options, and calculate.

Methodology

Formula or transformation

Computes a Gregorian interval as a direction with non-negative calendar components, or moves a date by an exact whole-day count.

Variables

  1. Calculation mode
  2. Start date
  3. End date
  4. Whole-day count
  5. Calendar year, month, and day components

Units

  • Calendar date
  • Day
  • Month
  • Year

Rounding policy

All date arithmetic uses whole calendar days; no fractional date is displayed.

Difference mode reports the direction separately, with non-negative calendar components and total days; arithmetic modes move the start date by an exact whole-day count.

Find the calendar difference between dates, or add and subtract a day count.

Reviewed sources

  1. PHP Documentation — DateTimeInterface::diff calendar difference Reviewed on 2026-09-07

Formula review history

  1. Initial formula and source review.

    Reviewed 2026-09-07 for formula version gregorian-date-operations-v1

Assumptions

  • Inputs are interpreted using the displayed units and options.
  • The calculation follows the methodology and factors listed in the sources.

Limitations

  • Display rounding can hide additional decimal places.
  • The calculation cannot add accuracy that is absent from the submitted inputs.

Worked example

Adding one day to 28 February 2024 returns 29 February 2024.

Frequently asked questions

Why is the difference never negative?

Difference mode reports the direction separately (forward or backward) and always shows non-negative calendar components and total days, so swapping the two dates only changes the direction. Calendar months count as completed when the same day number is reached, and a day the month lacks rolls into the next month, so in a common year 31 January to 28 February is 0 months and 28 days and 31 January to 3 March is 1 month.

How do the add and subtract modes count days?

They move the start date by the exact whole number of days you enter, so adding one day to 28 February 2024 gives 29 February 2024; months and years are not used in those modes.