[fpc-pascal] DateTimeToUnix bug?

Joost van der Sluis joost at cnoc.nl
Wed Dec 31 16:44:59 CET 2008


Op dinsdag 30-12-2008 om 21:44 uur [tijdzone -0200], schreef John
Coppens:
> On Tue, 30 Dec 2008 09:25:29 -0700
> "Seth Grover" <sethdgrover at gmail.com> wrote:
> 
> > Is this broken or am I missing something?
> 
> I suspect the problem is in this function:
> 
> Function SecondsBetween(const ANow, AThen: TDateTime): Int64;
> begin
>   Result:=Trunc(Abs(ANow-AThen)*SecsPerDay);
> end;                                                                            

This function is incorrect anyway, since it goes wrong around a datetime
of 0.

Joost




More information about the fpc-pascal mailing list