How to Get a list of valid time zones from windows?
Answer Posted / 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 View All Answers
How to Print in Delphi without using the TPrinter Unit ?
How to Create resource files?
How to Flush binary file from disk cache to disk ?
How to Change the owner of a component at runtime ?
How to Change the default width/height of the editor?
How to Retrieve the line number that a memo's cursor is on?
How to Remove drives listed in a TDriveComboBox ?
How to Retrieving the program that is associated with a given extension?
How to Get the time and date in Universal Time ?
How can one prevent a TForm from being moved or resized?
How to Save a QuickReport custom preview to text?
How to Determine the last access time of a given file ?