Skip to content

AddYears

Returns sum of specified dateTime and years.

1
myCalendar.AddYears(dateTime: DateTimeOffset, years: number):DateTimeOffset

Parameters

DateTimeOffset dateTime
    Specifies the base date time value.

number years
    Specifies the how many years will be added to dateTime parameter.

Remarks

Example

1
var newDate = $Calendar.AddYears($Calendar.Today, 3); //adds 3 years to the current date and returns DateTimeOffset object.

See Also