[Overview][Constants][Procedures and functions] |
Replace time part of a TDateTimevalue with another time.
Source position: dateutil.inc line 343
function RecodeTime( |
const AValue: TDateTime; |
const AHour: Word; |
const AMinute: Word; |
const ASecond: Word; |
const AMilliSecond: Word |
):TDateTime; |
AValue |
|
Date/time to recode |
AHour |
|
Hour to replace in AValue |
AMinute |
|
Minute to replace in AValue |
ASecond |
|
Second to replace in AValue |
AMilliSecond |
|
Millisecond to replace in AValue |
AValuewith replaced time.
RecodeTimereplaces the time part of the timestamp AValuewith the date specified in AHour, AMinute, ASecondand AMilliSecond. All other parts (the date part) of the date/time stamp are left untouched.
If one of the values AHour, AMinute, ASecondAMilliSecondis not within a valid range then an EConvertErrorexception is raised.
|
Replace year part of a TDateTimevalue with another year. |
|
|
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 selected parts of a TDateTimevalue with other values |
Program Example95; { This program demonstrates the RecodeTime function } Uses SysUtils,DateUtils; Const Fmt = 'dddd dd mmmm yyyy hh:nn:ss'; Var S : AnsiString; Begin S:=FormatDateTime(Fmt,RecodeTime(Now,8,0,0,0)); Writeln('Today, 8 AM : ',S); End.