Get time zone information

Posted in System info

Use GetTimeZoneInformation function. TIME_ZONE_INFORMATION structure contains all information about time and zone.

procedure TForm1.Button1Click(Sender: TObject);
var
  ZoneInfo: TTimeZoneInformation;
begin
  GetTimeZoneInformation(ZoneInfo);
  with Memo1.Lines do
  begin
    Add('Bias: '+ IntToStr(ZoneInfo.Bias));
    Add('StandardName: '+ZoneInfo.StandardName);
    Add('StandardBias: '+IntToStr(ZoneInfo.StandardBias));
    Add('DaylightName: '+ZoneInfo.DaylightName);
    Add('DaylightBias: '+IntToStr(ZoneInfo.DaylightBias));
  end;
end;