Explorar el Código

LocalToEpoch, EpochToLocal: android compilation

git-svn-id: trunk@47292 -
ondrej hace 4 años
padre
commit
6df9ad8e50
Se han modificado 1 ficheros con 10 adiciones y 6 borrados
  1. 10 6
      rtl/android/unixandroid.inc

+ 10 - 6
rtl/android/unixandroid.inc

@@ -68,21 +68,25 @@ begin
   cal:=ucal_open(PUnicodeChar(tz), Length(tz), PAnsiChar(locale), 0, err);
   if cal = nil then
     exit;
-  tzdaylight:=ucal_inDaylightTime(cal, err);
+  Tzinfo.daylight:=ucal_inDaylightTime(cal, err);
 
   SetLength(res, 200);
   SetLength(res, ucal_getTimeZoneDisplayName(cal, UCAL_SHORT_STANDARD, PAnsiChar(locale), PUnicodeChar(res), Length(res), err));
   TZStandardName:=utf8string(res);
-  tzname[False]:=PAnsiChar(TZStandardName);
+  Tzinfo.name[False]:=PAnsiChar(TZStandardName);
 
   SetLength(res, 200);
   SetLength(res, ucal_getTimeZoneDisplayName(cal, UCAL_SHORT_DST, PAnsiChar(locale), PUnicodeChar(res), Length(res), err));
   TZDaylightName:=utf8string(res);
-  tzname[True]:=PAnsiChar(TZDaylightName);
+  Tzinfo.name[True]:=PAnsiChar(TZDaylightName);
 
-  Tzseconds:=ucal_get(cal, UCAL_ZONE_OFFSET, err) div 1000;
-  if tzdaylight then
-    Tzseconds:=Tzseconds + ucal_get(cal, UCAL_DST_OFFSET, err) div 1000;
+  Tzinfo.seconds:=ucal_get(cal, UCAL_ZONE_OFFSET, err) div 1000;
+  if Tzinfo.daylight then
+    Tzinfo.seconds:=Tzinfo.seconds + ucal_get(cal, UCAL_DST_OFFSET, err) div 1000;
+
+  // ToDo: correct validsince/validuntil values
+  Tzinfo.validsince:=low(Tzinfo.validsince);
+  Tzinfo.validuntil:=high(Tzinfo.validuntil);
 
   ucal_close(cal);
 end;