随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

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  万一  阅读(...)  评论(...编辑  收藏