04-12-13, 03:54 AM
05-12-13, 10:07 PM
كود :
#Region "Set the date and time"
Public Structure SYSTEMTIME
Dim wYear As UInt16
Dim wMonth As UInt16
Dim wDayOfWeek As UInt16
Dim wDay As UInt16
Dim wHour As UInt16
Dim wMinute As UInt16
Dim wSecond As UInt16
Dim wMilliseconds As UInt16
End Structure
Declare Function GetSystemTime Lib "Kernel32.dll" _
(ByRef lpSystemTime As SYSTEMTIME) As UInt32
Declare Function SetSystemTime Lib "Kernel32.dll" _
(ByRef lpSystemTime As SYSTEMTIME) As UInt32
Public Sub SetTime(ByVal d As Date)
'التعديل على توقيت جرينتش
Dim st As New SYSTEMTIME
GetSystemTime(st)
st.wDay = d.Day ' اليوم
st.wMonth = d.Month ' الشهر
st.wYear = d.Year ' السنة
st.wHour = d.Hour ' الساعة24
st.wMinute = d.Minute ' الدقائق
'st.wSecond = d.Second ' الثواني
SetSystemTime(st)
End Sub
#End Region
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
SetTime(Date.UtcNow.AddHours(+1))
End Sub