Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2021-01

TimeZone problem

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Steve Gatenby

Would anybody be able to point me to a solution for incorrect time reading ?

I obviously have a configuration problem between System and FPC - any pointers much appreciated :)

Lazarus 2.1.0 r64403 FPC 3.3.1 x86_64-linux-gtk2

Xubuntu 20.10 Desktop

test fpc app -

   WriteLn('Local time offset (minutes): ', GetLocalTimeOffset);
   WriteLn('Local Time ', TimeToStr(Now), ' is UTC ',
TimeToStr(LocalTimeToUniversal(Now)));

outputs :

Local time offset (minutes): 0
Local Time 01:23:20 is UTC 01:23:20

'timedatectl' in terminal -

Local time: Mon 2021-01-18 11:24:21 AEST

Universal time: Mon 2021-01-18 01:24:21 UTC
RTC time: Mon 2021-01-18 01:24:21
Time zone: Australia/Brisbane (AEST, +1000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

Thanks - SteveG

Reply by email

Ondrej Pokorny
to Steve Gatenby
Steve Gatenby wrote 7 lines
Would anybody be able to point me to a solution for incorrect time reading ? I obviously have a configuration problem between System and FPC - any pointers much appreciated :) Lazarus 2.1.0 r64403 FPC 3.3.1 x86_64-linux-gtk2

Hello,

the linux timezone information is loaded in file
/trunk/rtl/unix/timezone.inc

You should check the functions GetTimezoneFile and ReadTimezoneFile.

Ondrej

Reply by email

Steve Gatenby
to Ondrej Pokorny
Ondrej Pokorny wrote 18 lines
On 18.01.2021 02:30, Steve Gatenby via lazarus wrote: > Would anybody be able to point me to a solution for incorrect time > reading ? > > I obviously have a configuration problem between System and FPC - any > pointers much appreciated :) > > Lazarus 2.1.0 r64403 FPC 3.3.1 x86_64-linux-gtk2 Hello, the linux timezone information is loaded in file /trunk/rtl/unix/timezone.inc You should check the functions GetTimezoneFile and ReadTimezoneFile. Ondrej

Thanks Ondrej (again)

I have concluded -> no idea :)

All seems to be reading correctly within fpc, just not calculating offsets as I would expect ?

My workaround was to create a custom zoneinfo file and use that on my dev system.

All working OK now, so will tentatively conclude is specific to my system configuration.

Regards - SteveG

Reply by email