[Lazarus] Possible error with Now function over summer/winter time change?

David Taylor david-taylor at blueyonder.co.uk
Mon Oct 28 08:49:13 CET 2013


On 27/10/2013 16:40, Michael Van Canneyt wrote:
[]
> It is a known problem.
>
> Doing this 100% correctly involves re-reading the timezone file at every
> call of Now() or Date().
> Clearly, this is a huge performance impact, severely skewing the time
> information.
>
> So this is not done.
>
> The "unix" unit contains
>
> Procedure ReReadLocalTime;
>
> which will re-initialize the necessary variables. You can call this
> routine at regular intervals as you see fit.
>
> In your case, you may want to insert a call to this after every clock
> update, which would be once a second.
>
> Michael.

Thanks, Michael, that's most helpful, I can call it once an hour which 
will be more than enough.

However, it seems that in the version I have for the Raspberry Pi (Laz: 
1.0.6 FPC: 2.6.0) the "Unix" unit does not contain this procedure.  I 
did find the source code for it, but I don't want to have to ask folk 
who might want to compile the clock program to have to also copy many 
lines of code from the Unix unit.  (Oh, and I tried both "unix" and 
"Unix" - both seemed to work.)

Am I missing something?

Thanks
-- 
David
Web: http://www.satsignal.eu





More information about the Lazarus mailing list