EVERYDAY CLARITY

Subtract Days Calculator

Find the calendar date a stated number of days before your starting date.

Enter your values

01
Gregorian calendar date in YYYY-MM-DD format; years 0001 through 9999.
integer 0..3652058

Use the stated calendar or timestamp format.

Your result
Date
2024-02-28

Result for the values shown.

Calculations run in your browser.

What to enter
InputMeaning and units
Calendar dateGregorian calendar date in YYYY-MM-DD format; years 0001 through 9999.
Daysinteger 0..3652058

Understanding your result

Calendar results use the stated counting and anniversary convention. Complete months and years differ from fixed day counts.

Common mistakes

  • Counting both end dates when the method excludes a boundary, or assuming all months have equal length.

Check your calculation

  • Test a short known interval and a leap-day boundary; for working days, verify your holiday list.

Calculation checks, sources and review limits

What date was a given number of days before this date?

Find the calendar date a stated number of days before your starting date.

Common uses

  • Find the calendar date a stated number of days before your starting date.

How it works

result=fromOrdinal(ordinal(date)-days) Calendar arithmetic uses the proleptic Gregorian calendar. Explicit calendar dates are independent of local daylight-saving changes. Month/year additions clamp to the last valid day of the destination month. Timestamp arithmetic requires a stated UTC offset and excludes leap seconds.

Worked example

Enter Calendar date: 2024-03-01; Days: 2. The result is Date: 2024-02-28.

FAQ

What date was a given number of days before this date?

result=fromOrdinal(ordinal(date)-days) Calendar arithmetic uses the proleptic Gregorian calendar. Explicit calendar dates are independent of local daylight-saving changes. Month/year additions clamp to the last valid day of the destination month. Timestamp arithmetic requires a stated UTC offset and excludes leap seconds.

What assumptions and limits apply?

Inputs and results must stay within the stated supported ranges.