[fpc-pascal] <time_fraction>Between bug?

Bee Jay bee.ography at gmail.com
Sun May 30 14:06:42 CEST 2010


Hi all,

Try the following code snippet:

uses
  DateUtils;
var
  a,b: TDateTime;
  i: integer;
begin
  a := EncodeDateTime(2010, 1, 1, 0, 0, 0, 0);
  for i := 0 to 9 do
  begin
    b := EncodeDateTime(2010, 1, 1, 0, 0, i, 0);
    Writeln(SecondsBetween(a,b):3);
  end;
end;

I think the result isn't correct. It also affects other <time_fraction>Between functions e.g. SecondsBetween, MinutesBetween, etc. 

But if I changed the milisecond part of a or b or both to anything but 0 then the result is correct. Is this a bug? Or did I miss something?

TIA.

-Bee-




More information about the fpc-pascal mailing list