Change System Date Time

Imports System.Runtime.InteropServices

_
Private Structure SYSTEMTIME
Public year As Short
Public month As Short
Public dayOfWeek As Short
Public day As Short
Public hour As Short
Public minute As Short
Public second As Short
Public milliseconds As Short
End Structure

_
Private Shared Function SetLocalTime(ByRef time As SYSTEMTIME) As Boolean

End Function

Private Sub SetDeviceTime(ByVal p_NewDate As Date)
'Populate structure...
'Substitute with your date object returned via GPRS...

Dim st As SYSTEMTIME
st.year = p_NewDate.Year
st.month = p_NewDate.Month
st.dayOfWeek = p_NewDate.DayOfWeek
st.day = p_NewDate.Day
st.hour = p_NewDate.Hour
st.minute = p_NewDate.Minute
st.second = p_NewDate.Second
st.milliseconds = p_NewDate.Millisecond

'Set the new time...
SetLocalTime(st)
End Sub

Comments