GetSystemTime Function

Declare Sub GetSystemTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME)

Platforms

Description & Usage

GetSystemTime retrieves the current system date and time and places it into a SYSTEMTIME structure. Times are always reported in UTC time (Coordinated Universal Time, a.k.a. Greenwich Mean Time (GMT)), not in the system's local time.

Return Value

GetSystemTime does not return a value.

Visual Basic-Specific Issues

None.

Parameters

lpSystemTime
Receives the current system date and time.

Example

' Display the current time in UTC time (along the Prime Meridian).
Dim utctime As SYSTEMTIME  ' receives time and date

GetSystemTime utctime  ' put the time and date in UTC time into utctime
Debug.Print "In Greenwich, England, the time is"; utctime.wHour; ":"; utctime.wMinute; ":"; utctime.wSecond

Related Functions

GetLocalTime, GetSystemTimeAsFileTime, SetSystemTime

Category

Time

Back to the index.


Last Modified: October 2, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information

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