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;

posted on 2007-11-27 15:35  万一  阅读(4256)  评论(9编辑  收藏  举报