For Newbie

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;

Share on Facebook
Share on Twitter
Share on Google+

Related : How to calculate the day on different dates.