datetime/add

Add or subtract years, months, weeks, days, hours, minutes, or seconds to a date.

Free / no pricing configured

What it does

Applies a calendar offset to a base date or datetime and returns the resulting date, its day of the week, and the full ISO timestamp. Any component may be negative to subtract.

Primary use cases

  • "What date is N days/weeks/months from X?"
  • Computing deadlines, renewal dates, or reminders.
  • Backdating ("30 days before today").

Good to know

date defaults to today. Month and year math is calendar-aware (e.g. adding 1 month to Jan 31 lands on the last day of February). Components may be negative. Computed locally.

Parameters

datestringoptional

Base date or datetime (YYYY-MM-DD or ISO 8601). Defaults to today.

daysintegeroptional

Days to add (negative to subtract).

hoursintegeroptional

Hours to add (negative to subtract).

weeksintegeroptional

Weeks to add (negative to subtract).

yearsintegeroptional

Years to add (negative to subtract).

monthsintegeroptional

Months to add (negative to subtract).

minutesintegeroptional

Minutes to add (negative to subtract).

secondsintegeroptional

Seconds to add (negative to subtract).

datetime/add — Faro