hi ihave made a custom fucntion in my application which takes millisec as argument and returns time in this format hh:mm:ss, but it doesn't work perfectly. here is the code
End FunctionVB Code:
Private Function GetDuration(time as Long) Dim h, m, s time = time / 1000 'Convert it to seconds 'Now Convert the time into Standard Format 'Hours h = Int(time / 3600) 'Minutes m = time / 3600 Mod 60 'Seconds s = time - (h * 3600) - (m * 60) 'Convert it to Format hh:mm:ss GetDuration = Format(h, "00") & ":" & Format(m, "00") & ":" & Format(s, "00")
in my application i run a timer every second which updates the time n the above function has to perform just like a digital clock, but the problem is that this function will just add seconds, n hours n minutes will always remain 0




Reply With Quote