Mega Code Archive

 
Categories / Delphi / Forms
 

Get time zone information

Title: Get time zone information 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;