System::DateTime::AddYears method

DateTime::AddYears method

Returns a new instance of the DateTime class representing the date and time value equal to that represented by the current object with the year component increased by the specified number.

DateTime System::DateTime::AddYears(int value) const
ParameterTypeDescription
valueintThe number of years to add; the value can be positive or negative

ReturnValue

A new instance of the DateTime class representing the date and time value equal to that represented by the current object with the year component increased by value

See Also