' Return an ISO 8601 compliant timestamp.
Private Function GetIsoTimestamp() As String
Dim st As SYSTEMTIME
' Get the local date and time.
GetLocalTime st
' Format the result.
GetIsoTimestamp = _
Format$(st.wYear, "0000") & "-" & _
Format$(st.wMonth, "00") & "-" & _
Format$(st.wDay, "00") & "T" & _
Format$(st.wHour, "00") & ":" & _
Format$(st.wMinute, "00") & ":" & _
Format$(st.wSecond, "00") & "." & _
Right$("000" & Format$(st.wMilliseconds), 3)
End Function
|