[fpc-devel] Problem with Now() and time changed by ntpd

Michael Van Canneyt michael at freepascal.org
Tue Nov 1 12:08:55 CET 2011



On Tue, 1 Nov 2011, Henry Vermaak wrote:

> On 01/11/11 10:30, Michael Van Canneyt wrote:
>> We'll simply need to store the next moment when the DST correction
>> changes, compare the result of gettimeofday with that and re-base the
>> time calculation. If we decide to add some check for the timestamp of
>> the timezone file - that would make Date(), Time() and Now() VERY
>> expensive operations.
>
> This seems to be what libc does (from looking at an strace of some gcc 
> binary).

Correct (I had checked as well), but the only purpose that serves 
is to check whether the system timezone info has changed.

This is something that normally doesn't happen unless you move your 
system from one timezone to another or during system setup, so I 
question the desirability of this check.

Michael.



More information about the fpc-devel mailing list