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 |
How to Create a PolyPolygon using a point array?
What is Delphi/400 Client Server Suite?
Does the BDE use Client side or server side cursors for MSSQL?
'Translate error, value out of bounds' error what does these errors mean?
How to Use GetTimeZoneInformation() function?
How to Change the main form of an application at runtime ?
What are Delphi and C++ Builder Action Lists and how to use them?
How to Calculate an angle from two points?
How to get Table data subset through IProvider ?
What is the procedure to connect delphi application to ms access database?
How to Insert a file at the cursor ?
Explain Drag and Drop with Files?