直接用两个datetime相减就可以了

解决方案 »

  1.   

    function Minutes(Time: TDateTime): integer;
    var
      H, M, S, MS: word;
    begin
      DecodeTime(Time, H, M, S, MS);
      result := H * 60 + M;
    end;
    function MinuteDiff(Beginning: TDateTime; Ending:TDateTime): integer;
    begin
        Result := Minutes(Ending - Beginning);
    end; 
      

  2.   

    你可以相减DATATIME1-DATATIME2>0即DATATIME1比DATATIME2晚
      

  3.   

    結賬
    TDateTime本身就是Double型的,當然可以直接減了
    呵呵
      

  4.   

    TDateTime类型其实是一个浮点数,整数部分代表天数(Delphi6开始是与1899年12月31日的差值,Delphi6以前是0000年00月00日之间的差值),小数点后的是毫秒数
      

  5.   

    http://61.129.81.122/yuleibo/bbs/dispbbs.asp?boardID=2&RootID=1429&ID=1429
      

  6.   

    function DaysBetween(const ANow, AThen: TDateTime): Integer;DescriptionCall DaysBetween to obtain the difference, in days, between two TDateTime values
    以前我用日期直接减也有错的~~上面是别人给我的答案。肯定正确^_*