date.subtract()

Subtract number of days from a Date.

Signature

subtract(count: Number, units String) => Date

Description

Gets the date for count subtracted from the instance Date.

Parameters

Parameter Type Required Description

count

Number

Yes

Number of units to subtract from the given date.

units

Number

Yes

Units of count. Must be days and case is significant.

Return value

Type Description

Number

Date of count subtracted from the instance 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!