VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Set System Time using SetSystemTime API

by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 1st August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Set System Time using SetSystemTime API

API Declarations


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.dll" (lpSystemTime As SYSTEMTIME) As Long


Rate Set System Time using SetSystemTime API



' Set the system time to
' March 26, 1987 20:45:00 Greenwich Time
Dim stime As SYSTEMTIME
Dim rval As Long
stime.wHour = 20
stime.wMinute = 45
stime.wSecond = 0
stime.wMilliseconds = 0
stime.wDay = 26
stime.wMonth = 3
stime.wYear = 1987
' Set time and date.
rval = SetSystemTime(stime)
End
End Sub


Download this snippet    Add to My Saved Code

Set System Time using SetSystemTime API Comments

No comments have been posted about Set System Time using SetSystemTime API. Why not be the first to post a comment about Set System Time using SetSystemTime API.

Post your comment

Subject:
Message:
0/1000 characters