[Lazarus] TimeZone problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] TimeZone problem

Free Pascal - Lazarus mailing list
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


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TimeZone problem

Free Pascal - Lazarus mailing list
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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TimeZone problem

Free Pascal - Lazarus mailing list

On 18/1/21 9:30 pm, Ondrej Pokorny wrote:

> 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



--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus