RecodeMilliSecond

Replace milliseconds part of a TDateTime value with another millisecond.

Declaration

Source position: dateutil.inc line 351

  function RecodeMilliSecond(const AValue: TDateTime; 
                            const AMilliSecond: Word) : TDateTime;

Description

RecodeMilliSecond replaces the millisecond part of the timestamp AValue with AMilliSecond. All other parts of the date/time stamp are left untouched.

Errors

If the AMilliSecond value is not within a valid range (0..999) then an EConvertError exception is raised.

See also

Name Description
RecodeDate Replace date part of a TDateTime value with another date.
RecodeDateTime Replace selected parts of a TDateTime value with other values
RecodeDay Replace day part of a TDateTime value with another day.
RecodeHour Replace hours part of a TDateTime value with another hour.
RecodeMinute Replace minutes part of a TDateTime value with another minute.
RecodeMonth Replace month part of a TDateTime value with another month.
RecodeSecond Replace seconds part of a TDateTime value with another second.
RecodeTime Replace time part of a TDateTime value with another time.
RecodeYear Replace year part of a TDateTime value with another year.

Example

Program Example93;
{ This program demonstrates the RecodeMilliSecond function }
Uses SysUtils,DateUtils;
Const
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';
Var
  S : AnsiString;
Begin
  S:=FormatDateTime(Fmt,RecodeMilliSecond(Now,0));
  Writeln('This moment, milliseconds stripped : ',S);
End.