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

VB Code:
  1. Private Function GetDuration(time as Long)
  2.  
  3.     Dim h, m, s  
  4.    
  5.     time = time / 1000 'Convert it to seconds
  6.    
  7.     'Now Convert the time into Standard Format
  8.         'Hours
  9.         h = Int(time / 3600)
  10.         'Minutes
  11.         m = time / 3600 Mod 60
  12.         'Seconds
  13.         s = time - (h * 3600) - (m * 60)
  14.        
  15.     'Convert it to Format hh:mm:ss
  16.     GetDuration = Format(h, "00") & ":" & Format(m, "00") & ":" & Format(s, "00")
End Function

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