Please help me find days between two dates.
I have two objects TDBDateEdit date1 and date2.
procedure Torder_form.date2Click(Sender: TObject);
var d3: TDateTime;
begin
d3:=date2.date - date1.date;
showmessage(datetostr(d3));
end.
I put to date1 = 07.10.2015
to date2 - 15.11.2015
Result must be: 39
But program gives me result: 07.02.1900
I found DaysBetween function. and I changed my codes like that
procedure Torder_form.date2Click(Sender: TObject);
var d3: TDateTime;
begin
d3:=DaysBetween(date2.date,date1.date);
showmessage(datetostr(d3));
end.
But programs says Result: 07.02.1900