请问如何求8:10:00和12:30:00之间差多少分钟

解决方案 »

  1.   

    ShowMessage(FormatDateTime('h:mm:ss',  StrToTime('8:10:00')-StrToTime('12:30:00')));
      

  2.   

    (StrToTime('12:30:00')-StrToTime('8:10:00'))*24*60
      

  3.   

    function MinutesBetween(const ANow, AThen: TDateTime): Int64;
      

  4.   

    (StrToTime('12:30:00')-StrToTime('8:10:00'))*24*60
      

  5.   

    ShowMessage(FloatToStr((StrToTime('8:10:00')-StrToTime('12:30:00'))*24*60));
      

  6.   

    在DateUtils单元中用MinuteOf函数哈function MinuteOf(const AValue: TDateTime): Word;
      

  7.   

    Var
      i:word
      id=minuteof(i_date)-minuteof(j_date)
      

  8.   

    function MinutesBetween(const ANow, AThen: TDateTime): Int64;或者利用DecodeTime(time:TTime;wHour,wMin,wSec,wMSec:word);
    分别解析两者后,求时、分、秒的差值就行了。很直接阿。