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 utctolocaltime... (https://www.delphipraxis.net/77478-utctolocaltime.html)

sveta 20. Sep 2006 08:22


utctolocaltime...
 
Hallo Profis,

kann mir jemand sagen warum utctolocaltime(mytime) bei mir 3 stunden vorgeht? mytime kommt von einer GPRMC datei und im Vergleich mit localzeit in deutschland geht eine stunde vor!

Danke :roll:

marabu 20. Sep 2006 08:43

Re: utctolocaltime...
 
Hallo sveta,

genau eine Stunde riecht irgendwie nach daylight savings time. Dazu das hier:

MS scheibt im PSDK zum Thema Local Time
To convert a UTC-based time to a local time, use the SystemTimeToTzSpecificLocalTime function.

Grüße vom marabu

sveta 20. Sep 2006 09:13

Re: utctolocaltime...
 
Danke Marabu

ich kenne mich pointern nicht so gut aus.. ich hab es versucht
Delphi-Quellcode:
  function myUTCToLocalTime(utctime: TDateTime): TDatetime;
  var
    TZ: TTimeZoneInformation;
    ST,outST : TSystemtime;

  begin
    GetTimeZoneInformation (TZ);
    GetSystemTime(ST);
    SystemTimeToTzSpecificLocalTime(TZ,ST,outST);
    Result:= EncodeDate(outst.wYear,outst.wMonth,outst.wDay)+EncodeTime(outst.wHour,outst.wMinute,outst.wSecond,outst.wMilliseconds);
  end; { myUTCToLocalTime }
ich mache etwas falsch
Incompatible types:ptimezoneinformation and _TIME_ZONE_INFORMATION

marabu 20. Sep 2006 09:29

Re: utctolocaltime...
 
Vergleiche doch mal mit diesem Code - vielleicht kannst du dabei deinen Fehler entdecken.

marabu

sveta 20. Sep 2006 09:59

Re: utctolocaltime...
 
daaaaaanke :hi:


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:49 Uhr.

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