Try this code
#If VBA7 Then
    Private Declare PtrSafe Function GetTickCount Lib "kernel32" () As Long
#Else
    Private Declare Function GetTickCount Lib "kernel32" () As Long
#End If

Function LastBootTime() As Date
    LastBootTime = Now - (GetTickCount / 1000 / 86400)
End Function

Sub Test_UDFs()
    MsgBox LastBootTime()
    MsgBox Format(GetTickCount() / 86400000, "HH:MM:SS")
End Sub