[Overview][Constants][Procedures and functions] | Reference for unit 'dateutils' (#rtl) |
Replace time part of a TDateTime value 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 |
AValue with replaced time.
RecodeTime replaces the time part of the timestamp AValue with the date specified in AHour, AMinute, ASecond and AMilliSecond. All other parts (the date part) of the date/time stamp are left untouched.
If one of the values AHour, AMinute, ASecondAMilliSecond 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 minutse part of a TDateTime value with another minute. |
|
|
Replace seconds part of a TDateTime value with another second. |
|
|
Replace milliseconds part of a TDateTime value with another millisecond. |
|
|
Replace date part of a TDateTime value with another date. |
|
|
Replace selected parts of a TDateTime value 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.
No notes exist for this page yet.