Difference between revisions of "SecondsToHMS"

From HashVB
Jump to: navigation, search
(Convert Seconds to Hours:Minutes:Seconds)
 
(No difference)

Latest revision as of 03:32, 20 June 2006

This function converts seconds to Hours:Minutes:Seconds format very easily. Example:

SecondsToHMS(300000000) = "05:20:00"
Option Explicit

Private Sub Form_Load()
    MsgBox SecondsToHMS(300000000)
End Sub

Public Function SecondsToHMS(strSeconds As Double)
    SecondsToHMS = Format$(DateAdd("s", strSeconds, 0), "hh:mm:ss")
End Function