Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

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")

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!