date.addYears()

date.addYears()

Description

The addYears() method adds the specified number of years to a date or timestamp value and returns the result.

Parameters

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

Return Value

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

Example

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

RPG Equivalent

%YEARS()


Related Pages