How to Get a list of valid time zones from windows?



How to Get a list of valid time zones from windows?..

Answer / Rajesh Kumar Sahu

To get a list of valid time zones in Windows using Delphi, you can utilize the TRegistry class. Here's a simple example:nn```delphinprocedure GetTimeZones(const RegPath: string; var Zones: TStringList);nvarn Key, Value: string;n I: Integer;nbeginn Registry.OpenKey(HKEY_LOCAL_MACHINE, RegPath, Key);n Zones := TStringList.Create;n for I := 0 to Key.NumberOfValues - 1 don beginn Key.GetValueName(I, Value);n if (Value = 'TZI') thenn Zones.Add(Key.OpenSubKey(Value).GetValue('DisplayName').StringValue);n end;nend;nn// Usage:nvar TimeZones: TStringList;nGetTimeZones('SYSTEMCurrentControlSetControlTimeZoneInformation', TimeZones);n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Delphi Interview Questions

How to Create a PolyPolygon using a point array?

1 Answers  


What is Delphi/400 Client Server Suite?

1 Answers   Delphi, IBM,


Does the BDE use Client side or server side cursors for MSSQL?

1 Answers  


'Translate error, value out of bounds' error what does these errors mean?

1 Answers  


How to Use GetTimeZoneInformation() function?

1 Answers  


How to Change the main form of an application at runtime ?

1 Answers  


What are Delphi and C++ Builder Action Lists and how to use them?

1 Answers  


How to Calculate an angle from two points?

1 Answers  


How to get Table data subset through IProvider ?

1 Answers  


What is the procedure to connect delphi application to ms access database?

1 Answers  


How to Insert a file at the cursor ?

1 Answers  


Explain Drag and Drop with Files?

1 Answers  


Categories