Delphi Tips Trick

For Newbie

Iklan Responsive Atas

LightBlog
Responsive Ads Here

Tuesday, 15 November 2011

How to calculate the day on different dates.



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;

No comments: