Einzelnen Beitrag anzeigen

Benutzerbild von hazard999
hazard999

Registriert seit: 2. Okt 2008
38 Beiträge
 
#8

Re: Berechnung:Ist grade Sommerzeit in einer bestimmter Zeit

  Alt 24. Nov 2009, 16:24
Ich hab die andere Richtung, vielleicht hilfts:

Delphi-Quellcode:
   function UTCToLocalTime(dateTime: TDateTime): TDateTime;
   var
      Info: TTimeZoneInformation;
      Status: DWORD;
   begin
      Status := GetTimeZoneInformation(Info);
      if (Status = TIME_ZONE_ID_UNKNOWN) or (Status = TIME_ZONE_ID_INVALID) then
         raise Exception.Create('Zeitzone ungültig');

      result := IncHour(dateTime, (Info.Bias div 60) * -1);
      result := IncMinute(result, (Info.Bias - ((Info.Bias div 60) * 60)) * -1);
      if Status = TIME_ZONE_ID_DAYLIGHT then
      begin
         result := IncHour(result, (Info.DaylightBias div 60) * -1);
         result := IncMinute(result, (Info.DaylightBias - ((Info.DaylightBias div 60) * 60)) * -1);
      end;
   end;
lg

hazard
  Mit Zitat antworten Zitat