DateTime AddYears Syntax:
public DateTime AddYears(int value);
Sample code that show how to add year in DateTime[C#] :
using System;
using System.Globalization;
public class DateTimeAddYear
{
public static void Main()
{
DateTime selectedDate = DateTime.Parse("2 Jan 2007");
selectedDate = selectedDate.AddYears(2);
Console.WriteLine(selectedDate.ToString("dd MMM yyyy"));
}
}
//Output //2 Jan 2009