2
0
Эх сурвалжийг харах

* Applied patch from Victor Campillo that adds GetLocalTimeOffset support
similar to win32. Mantis #24253

git-svn-id: trunk@24302 -

marco 12 жил өмнө
parent
commit
96da57ee95
1 өөрчлөгдсөн 16 нэмэгдсэн , 1 устгасан
  1. 16 1
      rtl/wince/sysutils.pp

+ 16 - 1
rtl/wince/sysutils.pp

@@ -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