--> How to calculate the day on different dates. | Delphi Tips Trick

For Newbie

Tuesday, 15 November 2011

How to calculate the day on different dates.

| Tuesday, 15 November 2011


Function declaration:
differencedate function (TglOld, TglNew: TDate): Integer;
begin
   Result: = trunc (TglNew - TglOld);
end;

Example of implementation:
procedure TForm1.Button1Click (Sender: TObject);
begin
   Edit1.Text: = IntToStr (differencedate (DateTimePicker1.Date, DateTimePicker2.Date));
end;

Related Posts

No comments: