There is this function :
Function TimeConversion(ByVal tempTime As Date) As String
'On Error GoTo Err_Error
' This routine is given values from the calling procedure and calculates the time
' beyond the obstacle of a 24-hour clock
Dim lngDays As Long, lngHours As Long, lngMinutes As Long, lngSeconds As Long
lngDays = Int(CSng(tempTime))
lngDays = lngDays * 24
lngHours = Int(CSng(tempTime * 24))
lngMinutes = Int(CSng(tempTime * 1440))
lngSeconds = Int(CSng(tempTime * 86400))
lngHours = lngDays + (lngHours Mod 24) ' calculate hours
lngMinutes = lngMinutes Mod 60
lngSeconds = lngSeconds Mod 60
TimeConversion = lngHours & ":" & IIf(lngMinutes <= 9, "0" & lngMinutes, lngMinutes) _
& ":" & IIf(lngSeconds <= 9, "0" & lngSeconds, lngSeconds)
Exit_Error:
Exit Function
Err_Error:
MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
Resume Exit_Error
End Function
QUESTION: Is there a function that do the exact opposite thing?
Thank you
Function TimeConversion(ByVal tempTime As Date) As String
'On Error GoTo Err_Error
' This routine is given values from the calling procedure and calculates the time
' beyond the obstacle of a 24-hour clock
Dim lngDays As Long, lngHours As Long, lngMinutes As Long, lngSeconds As Long
lngDays = Int(CSng(tempTime))
lngDays = lngDays * 24
lngHours = Int(CSng(tempTime * 24))
lngMinutes = Int(CSng(tempTime * 1440))
lngSeconds = Int(CSng(tempTime * 86400))
lngHours = lngDays + (lngHours Mod 24) ' calculate hours
lngMinutes = lngMinutes Mod 60
lngSeconds = lngSeconds Mod 60
TimeConversion = lngHours & ":" & IIf(lngMinutes <= 9, "0" & lngMinutes, lngMinutes) _
& ":" & IIf(lngSeconds <= 9, "0" & lngSeconds, lngSeconds)
Exit_Error:
Exit Function
Err_Error:
MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
Resume Exit_Error
End Function
QUESTION: Is there a function that do the exact opposite thing?
Thank you