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;