Hi everybody
I'm getting troubled with a date comparison inside a ttimer object, OnTimer event:
procedure TForm1.compareTimer(Sender: TObject);
var
i: integer;
aux: TDateTime;
begin
for i:=0 to ListOfNotifications.Items.Count-1 do
begin
aux := TMyNotify(ListOfNotifications.Items[i]).Get_MyDate();
if SameDateTime(Now, aux) then
notify();
end;
end;
I pick date and time from a ZVdatetime object (Get_MyDate() function) and problem is that SameDateTime(Now, aux) comparison fails almost always, except once every n-th try.
After multiple checkings i thought it can be a matter of milliseconds: ZVdatetime picker include a displaying format with them, even if apparently they don't seem to be important.
I set timer interval to 50 ms and it's always enabled.
Have you any suggestion?
Thanks