Closed zen010101 closed 2 weeks ago
We use the Tzseconds
global variable value from FPC RTL for the conversion.
Tzseconds
global variable value on those PC?Tzseconds
global variable value on those PC?RTC in local TZ: no
value?TZ
environment variable defined on those systems?Sounds like a bug in the FPC RTL, not in mORMot.
Hint: to fix and validate the FPC RTL? some reference code may be worth reading at https://github.com/golang/go/tree/master/src/time
We use the
Tzseconds
global variable value from FPC RTL for the conversion.
What is the RETURNED
Tzseconds
global variable value on those PC? 0What is the EXPECTED
Tzseconds
global variable value on those PC? it should be 28800. When I assigned it to the correct value, the FromNowLocal is correct too.By chance, isn't it on the PC which have
RTC in local TZ: no
value? what does it mean?What is the exact Linux distribution (name + version) on those PC? on not worked host: Ubuntu 20.04.6 LTS ( focal, 4.19.232 aarch64) on worked host: Debian GNU/Linux 11 (bullseye, 5.10.160 aarch64)
Is not the
TZ
environment variable defined on those systems? There is noTZ
environment variable on both systems.Sounds like a bug in the FPC RTL, not in mORMot. Yes, maybe is related about Tzseconds.
If TZSeconds = 0
, I guess it is indeed a bug in the FPC RTL, which is not able to properly handle Ubuntu - which is weird because it is Debian based.
RTC in local TZ: no
is a message available in the timedatectl
output.
Normally, the Bios RTC should be in local TZ, as requested for Windows.
If
TZSeconds = 0
, I guess it is indeed a bug in the FPC RTL, which is not able to properly handle Ubuntu - which is weird because it is Debian based.
RTC in local TZ: no
is a message available in thetimedatectl
output. Normally, the Bios RTC should be in local TZ, as requested for Windows.
RTC in local TZ: no
is in both outputs on hosts which worked and not worked.
After inspecting the issue, I found the key to this problem. On the host that is not working, the '/etc/timezone' file contains 'Etc/UTC' instead of the correct 'Asia/Shanghai' timezone. The FPC(timezone.inc
) looks for this information to determine the system's timezone. When I changed it to the correct timezone, the TZSeconds value was correct.
OS: Ubuntu 20.04.6 LTS (GNU/Linux 4.19.232 aarch64) fpc: 3.2.2 mormot2: stable
code is simple , but in some machines, it returns wrong local time .