GetElapsedTime


Public Function GetElapsedTime(tStart, tStop) As String

Dim dtr, dtl, jml As Long

    dtl = (Hour(tStart) * 3600) + _
          (Minute(tStart) * 60) + (Second(tStart))

    dtr = (Hour(tStop) * 3600) + _
          (Minute(tStop) * 60) + (Second(tStop))

 If tStop < tStart Then
   jml = 86400
 Else
   jml = 0
 End If
 jml = jml + (dtr - dtl)

 GetElapsedTime= Format(Str(Int((Int((jml / 3600)) Mod 24))), "00") _
                 + ":" + Format(Str(Int((Int((jml / 60)) Mod 60))) _
                 , "00") + ":" +Format(Str(Int((jml Mod 60))), "00")
End Function

No comments:

Post a Comment

Post Comments


Do you have any suggestions ? Add comment. Do not spam!