Option ExplicitDeclare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As IntegerEnd Type
Public Function MsDateFormat() As String Dim lpSystem As SYSTEMTIME GetSystemTime lpSystem Dim YMDHS As String Dim Ms As String
Dim lpSystem As SYSTEMTIME
GetSystemTime lpSystem
Dim YMDHS As String
Dim Ms As String
YMDHS = lpSystem.wYear & "/" & lpSystem.wMonth & "/" & lpSystem.wDay & " " & lpSystem.wHour & ":" & lpSystem.wMinute & ":" & lpSystem.wSecond
Ms = Format(lpSystem.wMilliseconds, "000")
MsDateFormat = Format(YMDHS, "YYYY/MM/DD HH:MM:SS") & "." & MsEnd Function
怎么得到运行时间大概就不用说了吧