[Lazarus] Possible error with Now function over summer/winter time change?
Sven Barth
pascaldragon at googlemail.com
Mon Oct 28 10:50:07 CET 2013
Am 28.10.2013 08:49, schrieb David Taylor:
> 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?
It's only in trunk for now.
@Marco: It's likely a good candidate to merge to 2.6.3 (it's revision
19569).
Regards,
Sven
More information about the Lazarus
mailing list