GlideDateTime - addYears(Number years)

Adds a specified number of years to the current GlideDateTime object. A negative parameter subtracts years.

Use addYearsLocalTime() or addYearsUTC() instead of this method.

Table 1. Parameters
Name Type Description
years Number The number of years to add. Use a negative value to subtract.
Table 2. Returns
Type Description

var gdt = new GlideDateTime("2010-08-31 08:00:00");

Output: 2011-08-31