Thread: Time Zone
View Single Post
  #7 (permalink)  
Old 10-05-2007, 03:06 AM
alfcen's Avatar
alfcen alfcen is offline
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

here you go...

HKEY_LOCAL_MACHINE\Time\TimeZoneInformation

The value is stored in minutes to account for 'exotic' time zones and is further negative for eastern zones.

I think the TZ can be extracted with the binary.dll with a few lines of code.

I did that before in embVB like this :

homezone = StringToLong(ReadReg(HKEY_LOCAL_MACHINE, "\Time", "TimeZoneInformation")) / 60 * -1

Private Function StringToLong(strValue As String) As Long
Dim strTemp As String
Dim intByte As Long
On Error Resume Next
For intByte = 4 To 1 Step -1
strTemp = strTemp & Hex(AscB(MidB(strValue, intByte, 1)))
Next intByte
StringToLong = CLng("&H" & strTemp)
End Function
Reply With Quote