RecodeSecond function
Replace seconds part of a
TDateTime value with another second.
Declaration
function RecodeSecond(const AValue: TDateTime; const ASecond: Word)
: TDateTimeArguments
AValue | Date/time to recode. |
ASecond | Second to replace in
|
Function result
AValue with replaced second.Description
RecodeSecond replaces the Second part of the timestamp
AValue
with
ASecond. All other parts of the date/time stamp are left untouched.Errors
If the
ASecond value is not within a valid range (0..59) then
an
EConvertError exception is raised.
See also
- RecodeYear
- RecodeMonth
- RecodeDay
- RecodeHour
- RecodeMinute
- RecodeMilliSecond
- RecodeDate
- RecodeTime
- RecodeDateTime
Example: ex92
Program Example92;
{ This program demonstrates the RecodeSecond function }
Uses SysUtils,DateUtils;
Const
Fmt = 'dddd dd mmmm yyyy hh:nn:ss';
Var
S : AnsiString;
Begin
S:=FormatDateTime(Fmt,RecodeSecond(Now,0));
Writeln('This moment, seconds stripped : ',S);
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
