newbie (lazy) question:
I need to change the system time in code.
(please post code)
Thank you.
Printable View
newbie (lazy) question:
I need to change the system time in code.
(please post code)
Thank you.
Here is a quick sample from allapi.com:
VB Code:
Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type Private Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long Private Sub Form_Load() 'KPD-Team 2000 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] Dim lpSystemTime As SYSTEMTIME lpSystemTime.wYear = 2000 lpSystemTime.wMonth = 1 lpSystemTime.wDayOfWeek = -1 lpSystemTime.wDay = 24 lpSystemTime.wHour = 23 lpSystemTime.wMinute = 26 lpSystemTime.wSecond = 0 lpSystemTime.wMilliseconds = 0 'set the new time SetSystemTime lpSystemTime End Sub
Thanks, Works Great!