Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#16

Re: Abweichung von UTC bekommen

  Alt 24. Mai 2007, 13:46
Man vergleiche:
shmia:
Delphi-Quellcode:
function GetTimeZoneBias:TDateTime;
const
   MINUTES_PER_DAY = 24.0 * 60.0;
var
  tzi : TTimeZoneInformation;
begin
   case GetTimeZoneInformation(tzi) of
      TIME_ZONE_ID_STANDARD:
         result := (tzi.Bias) / MINUTES_PER_DAY;

      TIME_ZONE_ID_DAYLIGHT: // Sommerzeit
         Result := (tzi.Bias+tzi.DaylightBias) / MINUTES_PER_DAY;
   else
      Result := 0.0;
   end;
end;
du:
Delphi-Quellcode:
function TXSPF.GetTimeZoneBias:String;
var
  tzi : TTimeZoneInformation;
begin
   case GetTimeZoneInformation(tzi) of
      TIME_ZONE_ID_STANDARD:
         result := intToStr(tzi.Bias div 60);

      TIME_ZONE_ID_DAYLIGHT: // Sommerzeit
         Result := IntToStr((tzi.Bias + tzi.DaylightBias) div 60);
   else
      Result := '00';
   end;
end;
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat