Declare Function SetSystemTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME) As Long
SetSystemTime sets the date and time of the system's clock. The time given to the function must be in UTC time (Coordinated Universal Time, a.k.a. Greenwich Mean Time (GMT)), not in the system's local time zone.
If an error occured, the function returns 0 (use GetLastError to get the error code). If successful, the function returns a non-zero value.
None.
' This code is licensed according to the terms and conditions listed here.
' Set the system clock to the following time:
' October 3, 1999 16:46:00 UTC
Dim systime As SYSTEMTIME ' new time and date
Dim retval As Long ' return value
' Put the date information into the structure.
systime.wYear = 1999
systime.wMonth = 10
systime.wDay = 3
systime.wHour = 16
systime.wMinute = 46
systime.wSecond = 0
systime.wMillisecond = 0
' Set the system clock to that time and date.
retval = SetSystemTime(systime)
Go back to the alphabetical Function listing.
Go back to the Reference section index.
Last Modified: October 3, 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/s/setsystemtime.html