diff options
author | ondrej <ondrej@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2020-11-03 14:31:24 +0000 |
---|---|---|
committer | ondrej <ondrej@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2020-11-03 14:31:24 +0000 |
commit | 74317ff774c2668a1086de4ee3bc3e94f0b0d95f (patch) | |
tree | 1ad9e463ab2be7dc42a77485e62ff98612a52366 /rtl | |
parent | c7db5a01f645fa12a9d233c87a29eb7b45812072 (diff) | |
download | fpc-74317ff774c2668a1086de4ee3bc3e94f0b0d95f.tar.gz |
LocalToEpoch, EpochToLocal: android compilation
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@47292 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl')
-rw-r--r-- | rtl/android/unixandroid.inc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rtl/android/unixandroid.inc b/rtl/android/unixandroid.inc index f8357b30d3..d5f109840c 100644 --- a/rtl/android/unixandroid.inc +++ b/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; |