[Overview][Constants][Procedures and functions][Index] |
Replace date part of a TDateTime value with another date.
Source position: dateutil.inc line 365
function RecodeDate( |
const AValue: TDateTime; |
const AYear: Word; |
const AMonth: Word; |
const ADay: Word |
):TDateTime; |
AValue |
|
Date/time to recode |
AYear |
|
Year to replace in AValue |
AMonth |
|
Month to replace in AValue |
ADay |
|
Day to replace in AValue |
AValue with replaced date.
RecodeDate replaces the date part of the timestamp AValue with the date specified in AYear, AMonth, ADay. All other parts (the time part) of the date/time stamp are left untouched.
If one of the AYear, AMonth, ADay values is not within a valid range then an EConvertError exception is raised.
|
Replace year part of a TDateTime value with another year. |
|
|
Replace month part of a TDateTime value with another month. |
|
|
Replace day part of a TDateTime value with another day. |
|
|
Replace hours part of a TDateTime value with another hour. |
|
|
Replace minutes part of a TDateTime value with another minute. |
|
|
Replace seconds part of a TDateTime value with another second. |
|
|
Replace date part of a TDateTime value with another date. |
|
|
Replace time part of a TDateTime value with another time. |
|
|
Replace selected parts of a TDateTime value with other values |
Program Example94; { This program demonstrates the RecodeDate function } Uses SysUtils,DateUtils; Const Fmt = 'dddd dd mmmm yyyy hh:nn:ss'; Var S : AnsiString; Begin S:=FormatDateTime(Fmt,RecodeDate(Now,2001,1,1)); Writeln('This moment on the first of the millenium : ',S); End.