Returns a DateTime object that is offset the specified number of years from the specified DateTime object.
- time
- The DateTime to which to add years.
- years
- The positive or negative number of years to add.
The DateTime object that results from adding the specified number of years to the specified DateTime object.
The DateTime.Kind property of the returned DateTime value always equals DateTimeKind.Unspecified. You can preserve the DateTime.Kind property of the time parameter by calling the DateTime.SpecifyKind(DateTime, DateTimeKind) method, as the following example shows.
code reference: System.Globalization.Calendar.AddMethods#8