[fpc-devel] DateTimeToTimeStamp

Micha Nelissen micha at neli.hopto.org
Tue Apr 11 18:31:45 CEST 2006


Hi,

Somebody has reported a bug for TDbf:

https://sourceforge.net/tracker/index.php?func=detail&aid=1466260&group_id=34085&atid=410671

function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
begin
  result.Time := Trunc(Frac(DateTime) * MSecsPerDay);
  result.Date := 1 + DateDelta + Trunc(System.Int(DateTime));
end ;

Why the extra "1 + " ? I think it would explain this person's bug report.

Micha



More information about the fpc-devel mailing list