Windows API Guide - Reference - Volume 1: Version 3.0 For the MS-DOS and PC-DOS Operating Systems
Declare Sub GetSystemTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME)
Platforms
- Windows 95: Supported.
- Windows 98: Supported.
- Windows NT: Requires Windows NT 3.1 or later.
- Windows 2000: Supported.
- Windows CE: Requires Windows CE 1.0 or later.
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
' This code is licensed according to the terms and conditions listed here. ' 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
See Also
GetLocalTime, GetSystemTimeAsFileTime, SetSystemTime
Category
Time
Go back to the alphabetical Function listing. Go back to the Reference section index.
Last Modified: October 2, 1999 This page is copyright © 1999 Paul Kuliniewicz. Copyright Information Revised October 29, 2000 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/getsystemtime.html