【发布时间】:2017-05-16 16:12:56
【问题描述】:
我正在处理以前开发人员的代码。此代码已设置 SystemTime。 有没有办法以这种格式获取今天的日期和负 30 天?
代码如下:
Public Function GetIsoTimestampTest() As String
Dim st As SYSTEMTIME
'Get the local date and time
GetSystemTime st
'Format the result
GetIsoTimestampTest = _
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") & "Z"
End Function
【问题讨论】:
标签: ms-access vba systemtime