* Applied patch from Victor Campillo that adds GetLocalTimeOffset support

similar to win32. Mantis #24253

git-svn-id: trunk@24302 -
This commit is contained in:
marco 2013-04-22 15:58:15 +00:00
parent abc79bc4cf
commit 96da57ee95

View File

@ -30,7 +30,7 @@ uses
{$DEFINE HAS_OSERROR}
{$DEFINE HAS_OSCONFIG}
{$DEFINE HAS_TEMPDIR}
{$DEFINE HAS_LOCALTIMEZONEOFFSET}
{ Include platform independent interface part }
{$i sysutilh.inc}
@ -468,6 +468,21 @@ begin
windows.Getlocaltime(SystemTime);
end;
function GetLocalTimeOffset: Integer;
var
TZInfo: TTimeZoneInformation;
begin
case GetTimeZoneInformation(TZInfo) of
TIME_ZONE_ID_UNKNOWN:
Result := TZInfo.Bias;
TIME_ZONE_ID_STANDARD:
Result := TZInfo.Bias + TZInfo.StandardBias;
TIME_ZONE_ID_DAYLIGHT:
Result := TZInfo.Bias + TZInfo.DaylightBias;
else
Result := 0;
end;
end;
{****************************************************************************
Misc Functions