date.subtractYears()

date.subtractYears()

Description

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

Parameters

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

Return Value

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

Example

pjs.define("date", { type: 'date', initValue: '2017-01-01' }); date = date.subtractYears(10); return date; // 2007-01-01

RPG Equivalent

%YEARS()


Related Pages