adjustYear (NotesDateTime - JavaScript)

Increments a date-time by a number of years.

Defined in

NotesDateTime

Syntax

adjustYear(n:int) : void

adjustYear(n:int, preservelocaltime:boolean) : void

Parameter Description
n The number of years by which to increment the date-time. Can be positive or negative.
preservelocaltime Affects adjustments that cross a daylight savings boundary. Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day. If this parameter is false or omitted, GMT time remains as adjusted and local time gains or loses an hour.

Usage

If the NotesDateTime object consists of only a time component, this method has no effect.

The number of years by which you increment a NotesDateTime object can cause the century to change. If this happens, the year is represented as a string with four digits instead of two, such as 08/18/2001.

Examples

This computed field increments a date-time value.
var dt:NotesDateTime = session.createDateTime("Today");
dt.adjustYear(1);
return "Due date: " + dt.getDateOnly();