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 find what the user path is for their Environment Variables?
What does the error 'Token not found'?
How to create a transparent form?
How to Create NonMaintained or .NDX indexes on dBASE Tables?
How to Extract an icon from a .exe or .dll?
How to draw directly on the Windows Desktop?
What is the function of inheritance in delphi?
what are Safe Mode and VGA mode?
What to do if getting missing or corrupted file messages?
How to get serial number of my drive ?
How to avoid "Random" Exceptions being raised when using TJPEGImage or the JPEG unit?
How to Get a list of valid time zones from windows?