O oldnew Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-03 #1 比如判断某一天距离今天有多少天? 用什么函数啊?[8D][8D][]
3 3368aa Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-04 #2 直接减就行了 日期型其实是一个双精度的数值 整数部分是天数,小数部分是时分秒
F flyat Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-04 #3 var v1,v2:TDate; begin ShortDateFormat:='y/m/d'; DateSeparator := '-'; v1:=StrToDate('1998-12-26'); v2:=StrToDate('1997-11-2'); MessageDlg('相差天数为:'+IntToStr(Trunc(v1-v2)),mtInformation,[mbOK],0); end;
var v1,v2:TDate; begin ShortDateFormat:='y/m/d'; DateSeparator := '-'; v1:=StrToDate('1998-12-26'); v2:=StrToDate('1997-11-2'); MessageDlg('相差天数为:'+IntToStr(Trunc(v1-v2)),mtInformation,[mbOK],0); end;
J jsxjd Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-04 #4 var a,b:TDate; d:Integer; begin a:=...; b:=...; d:=(trunc(a)-trunc(b)); end;