Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Source for Timezone table
Message
From
06/01/2009 21:13:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/01/2009 11:20:32
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01371091
Message ID:
01371554
Views:
15
>>
>>You can get timezones from "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones" registry entry.
>
>Cetin
>
>Do you mind to share your code to list the options (with description and date inf. dif.).. I'm facing more dif. than I hope.. So if you don't mind.. you'll help me a lot..
>
>TIA

Couldn't cleanup mine but this is somewhat is the list part:
#Define HKEY_LOCAL_MACHINE   -2147483646
lcKey    = 'Software\Microsoft\Windows NT\CurrentVersion\Time Zones'

Create Cursor TZList (TzID i,TzName c(100))
Create Cursor TZDetail (TzID i,property c(20), Value c(100))

Local loReg As "registry" Of Home()+'ffc\registry.vcx'
loReg = Newobject("registry",Home()+'ffc\registry.vcx')
loReg.openkey(m.lcKey,HKEY_LOCAL_MACHINE)
Local Array aKeys[1],aSubValues[1]
loReg.enumkeys(@aKeys)

Local ix,jx
For ix = 1 To Alen(aKeys)
  Insert Into TZList (TzID,TzName) Values (m.ix,aKeys[m.ix])

  lcSubKey = Addbs(Addbs(m.lcKey)+aKeys[m.ix])
  loReg.openkey(m.lcSubKey,HKEY_LOCAL_MACHINE)
  loReg.Enumkeyvalues(@aSubValues)

  For jx = 1 To Alen(aSubValues,1)
    Insert Into TZDetail (TzID,property,Value) ;
      VALUES ;
      (m.ix,aSubValues[m.jx,1], aSubValues[m.jx,2])
  Endfor

Endfor

Select t1.TzID, t1.TzName, ;
  dName.Value As 'DisplayName', ;
  cast(Strextract(dName.Value,'(GMT',') ',1,1) As c(6)) As Offset,;
  dlt.Value As 'Dlt', ;
  st.Value As 'Std' ;
  FROM TZList t1 ;
  INNER Join ;
  (Select TzID, Value From TZDetail ;
  where Upper(property)=='DISPLAY') dName On dName.TzID = t1.TzID ;
  INNER Join ;
  (Select TzID, Value From TZDetail ;
  where Upper(property)=='DLT') dlt On dlt.TzID = t1.TzID ;
  INNER Join ;
  (Select TzID, Value From TZDetail ;
  where Upper(property)=='STD') st On st.TzID = t1.TzID ;
  INTO Cursor TZInfo

Browse Last
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform