Declare Sub GetLocalTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME)
GetLocalTime returns the system's time and date. The various features of the time and date (month, day, hour, minute, second, etc.), down to the millisecond, are sorted in the variable passed as lpSystemTime! Windows considers "local time" to be the system's current time.
Example:
Dim loctime As SYSTEMTIME
' Print the date in mm-dd-yyyy format.
GetLocalTime loctime
Debug.Print loctime.wMonth; "-"; loctime.wDay; "-" loctime.wYear
Related Call: GetSystemTime
Category: System Information
Back to the index.