var A:tdate; var B:tdate; var C:tdate; begin A:=StrToDate(FirstDay); B:=StrToDate(SecondDay); C:=A-B;//c就是天数, end;
var A:tdate; B:tdate; firstday,secondday:string; begin firstday:='1999-8-30'; secondday:='2001-8-23'; A:=StrToDate(FirstDay); B:=StrToDate(SecondDay); edit1.Text:=inttostr(daysbetween(a,b));
var a:tdate; b:tdate; c:tdabe; begin a:=DateTimePickerStart.date; b:=DateTimePicerEnd.date; c:=A-B;//c就是天数, Label1.Caption:=DateToStr(C); end 这样好象也不行?
var A:tdate; var B:tdate; var C:Int; begin A:=StrToDate(FirstDay); B:=StrToDate(SecondDay); C:=A-B;//c就是天数, Label1.Caption:=IntToStr(C); end;
呵呵~不小心错了~ procedure TForm1.Button6Click(Sender: TObject); var A:tdate; var B:tdate; var C:Double; begin A:=StrToDate('2001-08-21'); B:=StrToDate('2001-08-25'); C:=A-B;//c就是天数, Label1.Caption:=FloatToStr(C); end;
var B:tdate;
var C:tdate;
begin
A:=StrToDate(FirstDay);
B:=StrToDate(SecondDay);
C:=A-B;//c就是天数,
end;
B:tdate;
firstday,secondday:string;
begin
firstday:='1999-8-30';
secondday:='2001-8-23';
A:=StrToDate(FirstDay);
B:=StrToDate(SecondDay);
edit1.Text:=inttostr(daysbetween(a,b));
a:tdate;
b:tdate;
c:tdabe;
begin
a:=DateTimePickerStart.date;
b:=DateTimePicerEnd.date;
c:=A-B;//c就是天数,
Label1.Caption:=DateToStr(C);
end
这样好象也不行?
//Label1.Caption:=DateToStr(C);这个可定不行了。
var B:tdate;
var C:Int;
begin
A:=StrToDate(FirstDay);
B:=StrToDate(SecondDay);
C:=A-B;//c就是天数,
Label1.Caption:=IntToStr(C);
end;
procedure TForm1.Button6Click(Sender: TObject);
var A:tdate;
var B:tdate;
var C:Double;
begin
A:=StrToDate('2001-08-21');
B:=StrToDate('2001-08-25');
C:=A-B;//c就是天数,
Label1.Caption:=FloatToStr(C);
end;