Declare Sub GetLocalTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME)
Platforms: Win 95/98, Win NT
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:
' Print the current date in mm-dd-yyyy format
Dim localtime As SYSTEMTIME ' receives the computer's time and date
GetLocalTime localtime ' read the computer's time and date
' Display the date
Debug.Print localtime.wMonth; "-"; localtime.wDay; "-"; localtime.wYear
See Also: GetSystemTime
Category: Time
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/g/getlocaltime.html