The Fauna service will be ending on May 30, 2025.

For more information on the service wind down, see our announcement and the Fauna Service End-of-Life FAQ.

date.subtract()

Subtract number of days from a Date.

Signature

subtract(amount: Number, unit: String) => Date

Description

Subtracts a provided number of days from a Date.

Parameters

Parameter Type Required Description

amount

Number

true

Number of units to subtract from the given date.

unit

Number

true

Unit for the operation. Must be days (case-sensitive).

Return value

Type Description

Date

Resulting date

Examples

Date('2099-02-10').subtract(41, 'days')
Date("2098-12-31")
\