[SOLVED] System.Now gives timestamp which is eight hours back lazarus / 32-Linux ---------------------------------------------------------------------- alpine · 2024-04-24 16:58 Today I have installed a program written in FPC on a Debian 12 bookworm (32-bit) and to my surprise it logs all of its events with a timestamp which is 8 hours back in the past. Those stamps are result from calling the System.Now function. The program runs properly on a several other Linux machines. I don't have a clue where the problem lies with that particular Debian machine. Here is the output from timedatectl: Code: [Select]# timedatectl                Local time: Wed 2024-04-24 19:47:15 EEST            Universal time: Wed 2024-04-24 16:47:15 UTC                  RTC time: Wed 2024-04-24 16:47:15                 Time zone: Europe/Sofia (EEST, +0300) System clock synchronized: yes               NTP service: active           RTC in local TZ: noand it is quite correct. The printout from the program: Code: [Select]TimeLogNow: 135843986499, TimeLogToDateTime(TimeLogNow): 2024.04.24 11:49 Now: 2024.04.24 11:49, TimeLogFromDateTime(Now): 135843986499The difference is exactly -8 hrs, (+2 min not relevant, execution difference) Traced back the Now function until found an external: Now -> GetLocalTime -> DoGetLocalDateTime -> fpgettimeofday -> external name 'FPC_SYSC_GETTIMEOFDAY' Anybody have a clue? ---------------------------------------------------------------------- Thaddy · 2024-04-24 17:59 now relies on the system clock, so check the system clock. it does not rely on a time sever, only indirect if the system clock is syncronized, ---------------------------------------------------------------------- Kays · 2024-04-24 18:14 Ensure that now writes to tDateTime variables, not any other real type. Unfortunately they are assignment‑compatible so no error reporting, but strange results. ---------------------------------------------------------------------- alpine · 2024-04-24 18:29 Thanks for the replies! It actually was due to some OS misconfiguration, I don't know how it happened... Despite the right printout from the timedatectl, the command: Code: [Select]#cat /etc/timezone printed: Code: [Select]US/Central and after dpkg-reconfigure tzdata with the right location, which was also preselected (?!) as it was set correctly (it wasn't) now it prints:  Code: [Select]#cat /etc/timezone Europe/Sofia After the reboot it now seems to be OK. Sorry for the noise. ---------------------------------------------------------------------- Thaddy · 2024-04-25 15:04 Don't worry, this is a quite common oversight. Glad it works now.