Advertisement
datatheoz

VB6 Seconds to time format for Case

Apr 11th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Function ToTime(secs As Long) As String
  2.     Dim hrs As Integer
  3.     Dim mins As Integer
  4.    
  5.     Do While secs > 59
  6.         secs = secs - 60
  7.         mins = mins + 1
  8.         If mins > 59 Then
  9.             mins = 0
  10.             hrs = hrs + 1
  11.         End If
  12.     Loop
  13.      
  14.     ToTime = Format(hrs, "00") & ":" & Format(mins, "00") & ":" & Format(secs, "00")
  15. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement