تابعی برای تبدیل ثانیه به ، ساعت:دقیقه:ثانیه
Public Function ConvertSeconds(lSeconds As Long) As String
Dim lTmpMinutes As Long
Dim lTmpSeconds As Long
Dim lTmpHours As Long
If lSeconds > 59 Then
lTmpSeconds = lSeconds Mod 60
If lSeconds > 3599 Then
lTmpHours = Fix(lSeconds / 3600)
lTmpMinutes = lSeconds / 60 - (60 * lTmpHours)
ConvertSeconds = lTmpHours & ":" & Format _
(lTmpMinutes, "00") & ":" & Format(lTmpSeconds, "00")
Else
lTmpMinutes = Fix(lSeconds / 60)
ConvertSeconds = lTmpMinutes & ":" & _
Format(lTmpSeconds, "00")
End If
Else
ConvertSeconds = "0:" & Format(lSeconds, "00")
End If
End Function
