procedure TForm1.Button1Click(Sender: TObject); var i: Real; begin i := StrToDate('2008-1-1') - StrToDate('2007-1-1'); ShowMessage(FloatToStr(i)); //返回的结果是365天 i := StrToDate('2009-1-1') - StrToDate('2008-1-1'); ShowMessage(FloatToStr(i)); //返回的结果是366天 end;