Skip to content

Flow documentation · legacy product

RecodeYear ​

Declaration ​

Function RecodeYear(const AValue: TDateTime; const AYear: Word): TDateTime

Example ​

pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := RecodeYear(Date, 2010); // if Date is 2009-06-25 then result is 2010-06-25
end;

Description ​

Replaces the year for a specified TDateTime value. Use RecodeYear to convert the date/time value specified by AValue with the value obtained by changing the year to AYear. Legal values for AYear range from 1 to 9999.

If the value provided for AYear is not in the legal range, or if the change results in an invalid day of the month (changing Feb 29 on a leap year to a non-leap year), RecodeYear raises an exception.