This function will convert numbers to time in the format of hh:mm:ss
Option Explicit
Private Function Num2Time(myNumber As Long) As String
'Convert number of seconds since midnight to a string of format "hh:nn:ss"
Dim myString As String
Dim myHours As Long
Dim myMinutes As Long
Dim mySeconds As Long
On Error GoTo Num2TimeError
myHours = myNumber \ 3600
myMinutes = (myNumber - (myHours * 3600)) \ 60
mySeconds = myNumber - ((myHours * 3600) + (myMinutes * 60))
myString = Format(TimeSerial(myHours, myMinutes, mySeconds), "hh:nn:ss am/pm")
Num2Time = myString
Exit Function
Num2TimeError:
MsgBox Err.Number & ": " & Err.Description, vbInformation, "Num2Time"
End Function
Private Sub Form_Load()
Text1 = Num2Time(31536000)
End Sub