[Overview][Constants][Procedures and functions] |
Replace year part of a TDateTimevalue with another year.
Source position: dateutil.inc line 335
function RecodeYear( |
const AValue: TDateTime; |
const AYear: Word |
):TDateTime; |
AValue |
|
Date to recode |
AYear |
|
Year to replace in AValue |
AValuewith replaced year.
RecodeYearreplaces the year part of the timestamp AValuewith AYear. All other parts of the date/time stamp are left untouched.
If the AYearvalue is not within a valid range (1..9999) then an EConvertErrorexception is raised.
|
Replace month part of a TDateTimevalue with another month. |
|
|
Replace day part of a TDateTimevalue with another day. |
|
|
Replace hours part of a TDateTimevalue with another hour. |
|
|
Replace minutse part of a TDateTimevalue with another minute. |
|
|
Replace seconds part of a TDateTimevalue with another second. |
|
|
Replace milliseconds part of a TDateTimevalue with another millisecond. |
|
|
Replace date part of a TDateTimevalue with another date. |
|
|
Replace time part of a TDateTimevalue with another time. |
|
|
Replace selected parts of a TDateTimevalue with other values |
Program Example87; { This program demonstrates the RecodeYear function } Uses SysUtils,DateUtils; Const Fmt = 'dddd dd mmmm yyyy hh:nn:ss'; Var S : AnsiString; Begin S:=FormatDateTime(Fmt,RecodeYear(Now,1999)); Writeln('This moment in 1999 : ',S); End.