Hi everybody,
Here are the routines for retrieving the Time Zone.
Tested with PPC2003SE, not tested under WM5.x/6.x.
Tested on desktop with XP Home Edition.
Perhaps there is a more elegant solution involving less code.
Please use or abuse
(transferred from the Wishlist)
Here are the routines for retrieving the Time Zone.
Tested with PPC2003SE, not tested under WM5.x/6.x.
Tested on desktop with XP Home Edition.
Perhaps there is a more elegant solution involving less code.
Please use or abuse
(transferred from the Wishlist)
B4X:
Sub App_Start
Reg.New1 'registry.dll
Bit.New1 'bitwise.dll
End Sub
Sub Globals
Dim zti(0) As Byte 'Array for binary data (PPC), registry entry is binary
End Sub
Sub GetTimeZone
Dim m, i
Reg.RootKey(Reg.rtLocalMachine)
If CPPC = True Then
zti()=Reg.GetValue("Time","TimeZoneInformation")
For i = 3 To 0 Step -1
m = m & bit.DecToHex(zti(i))
Next
Return bit.HexToDec(m) / 60 * (-1)
Else
m = Reg.GetValue("System\CurrentControlSet\Control\Tim eZoneInformation","ActiveTimeBias")
Return m / 60 * (-1)
End If
End Sub
Sub GetDayLightSavingHour
'for the desktop only
Return Reg.GetValue("System\CurrentControlSet\Control\Tim eZoneInformation","StandardBias")
End Sub