AddYears(Value: DateTime; Count: Integer): DateTime;
Value - initial date.
Count - the number of added years.
The AddYears method adds the specified number of years to the initial date passed as the Value parameter.
Sub Main;
Var
DT, DT1, DT2: DateTime;
Begin
DT := DateTime.Parse("01.01.2004 00:00:00");
DT1 := DateTime.AddYears(DT, 1);
DT2 := DateTime.AddYears(DT, -3);
End Sub Main;
After executing the example the "DT", "DT1", "DT2" variables will contain the following values:
"DT" - "01.01.2004"
"DT1" - "01.01.2005"
"DT2" - "01.01.2001"
See also: