mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-23 07:09:18 +02:00
* Applied patch from Victor Campillo that adds GetLocalTimeOffset support
similar to win32. Mantis #24253 git-svn-id: trunk@24302 -
This commit is contained in:
parent
abc79bc4cf
commit
96da57ee95
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user