date.subtractMonths()

date.subtractMonths()

Description

The subtractMonths() method subtracts the specified number of months from a date or timestamp value and returns the result.

Parameters

  1. Numeric value - The number of months to subtract.

Return Value

A date or timestamp with the specified number of months subtracted.

Example

pjs.define("date", { type: 'date', initValue: '2017-11-01' }); date = date.subtractMonths(2); return date; // 2017-09-01

RPG Equivalent

%MONTHS()


Related Pages