GetLocalTime Function

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.

lpSystemTime
Variable that receives the computer's date and 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

Related Call: GetSystemTime
Category: Time
Back to the index.


Go to Paul Kuliniewicz's Home Page.
E-mail: rogue953@hotmail.com
This page is at http://skyscraper.fortunecity.com/transmission/45/api/g/getlocaltime.html