Skip to content

Calendar.AddYears

Overview

DateTimeOffset Calendar.AddYears ( dateTime, years )
Returns sum of specified dateTime and years.

Arguments

$paramType Argument Name Specifies the base date time value.

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

Remarks

Examples

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

See Also