Public Function SecondsToDateTimeSerial(ByVal Sec As Long) As String
Dim lngSecParam As Long
Dim lngSeconds As Long
Dim lngHours As Long
Dim lngMinutes As Long
Dim tempSecParam As Long
lngSecParam = Sec
lngSeconds = lngSecParam \ 86400
lngSecParam = lngSecParam - (lngSeconds * 86400)
lngHours = lngSecParam \ 3600
lngSecParam = lngSecParam - (lngHours * 3600)
lngMinutes = lngSecParam \ 60
lngSecParam = lngSecParam - (lngMinutes * 60)
tempSecParam = lngSecParam
SecondsToDateTimeSerial = _
IIf(Sec >= 86400, lngSeconds & " day(s), ", vbNullString) & _
IIf(Sec >= 0, Format(lngHours, "0#") & ":", vbNullString) & _
Format(lngMinutes, "0#") & ":" & Format(tempSecParam, "0#")
End Function
Sunday, June 17, 2012
Konversi Detik Ke Hari, Jam, Menit, dan Detik
Labels:
Date And Time