Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Gebietsschema & Zeitzone (https://www.delphipraxis.net/5768-gebietsschema-zeitzone.html)

Tpercon 18. Jun 2003 15:05


Gebietsschema & Zeitzone
 
Wie ermittel ich das auf dem System eingestellte Gebietsschema? & die zugehörige Zeitzone?

Jens Schumann 18. Jun 2003 15:15

Hallo,
in der MSDN Online Library steht folgendes
GetTimeZoneInformation
Dort findest Du bestimmt auch eine API-Funktion zum Gebietsschema

Die benötigte Struktur (Parameter) ist in Windows.pas als TTimeZoneInformation deklariert (Zeile 4524 (Delphi 5)

Tpercon 18. Jun 2003 15:18

Das habe ich auch schon gefunden, nur werde ich daraus leider nicht wirklich schlau!

Jens Schumann 18. Jun 2003 15:40

Hallo,
ich denke so sollte es klappen
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
   TZI : TTimeZoneInformation;
begin
  GetTimeZoneInformation(TZI);
  ShowMessage(TZI.StandardName+#13#10+TZI.DaylightName);
end;

Tpercon 18. Jun 2003 16:02

Ja!

Die Zeitzone lese ich jetzt so aus:
Delphi-Quellcode:
function TForm1.GetTimeZone:string;
var TZI : TTimeZoneInformation;
begin
 case GetTimeZoneInformation(TZI) of
  TIME_ZONE_ID_UNKNOWN: result:= 'Unbekannt';
  TIME_ZONE_ID_DAYLIGHT: result:= TZI.DaylightName;
  TIME_ZONE_ID_STANDARD: result:= TZI.StandardName;
 else result:= 'Unbekannt';
 end;
end;
Hat jemand eine Idee für das Gebietsschema?


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:34 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz