以下两个是本人用的时间计算函数<br>FUNCTION SYS_SECS(Sec: ShortString) :Integer; export;<br>Var H , M , S : Integer;<br>Begin<br> //HH:MM:SS<br> H:=StrToInt(Copy(Sec,1,2))*3600;<br> M:=StrToInt(Copy(Sec,4,2))*60;<br> S:=StrToInt(Copy(Sec,7,2));<br> Result:=H+M+S;<br>End;<br><br>FUNCTION TIMEApart(Start,Ends :ShortString):String; export;<br>Var X, H, M ,S: Integer;<br><br>Begin<br> If SYS_SECS(Ends) <SYS_SECS(Start) then<br> X:=86400+SYS_SECS(Ends)-SYS_SECS(Start)<br> Else<br> X:=SYS_SECS(Ends)-SYS_SECS(Start);<br><br> H:=Trunc(X/3600) Mod 24;<br> M:=Trunc(X/60)-(Trunc(X/60) div 60)* 60;<br> S:=X -(X div 60)*60;<br> Result:=_StrZero(H,2)+':'+_StrZero(M,2)+':'+_StrZero(S,2);<br>End;<br>