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

zeljko zeljko at holobit.net
Tue Nov 1 20:08:59 CET 2011


On Tuesday 01 of November 2011 19:18:38 you wrote:

> It will be something like that, yes. I was thinking of introducing a
> 
> CheckRefreshTZInfoInterval: integer;
> 
> -1 : never check for refresh (current behaviour)
> 0  : refresh on each call (like LibC, will be new default)
> 
> >0 : Only refresh every N [yourfavouriteinterval].
> 
> But of course not in fpgettimeofday, in EpochToLocalTime. I repeat:
> fpgettimeofday returns UTC time, it does not need to read timezone info.

Yes, you're correct here.

> 
> It is the step which converts this time to local time that must re-read the
> timezone files if needed. (EpochToLocalTime, the equivalent of localtime_r
> in libc)
> 
> However, meanwhile:
> 3. A more simple mechanism is using the (newly added) ReReadTimeZone (unix
> unit):
> 
>    ReReadTimeZone;
> 
> Which will re-read TZ and re-calculate DST settings all in one go.
> I added this in revision 19569. The idea is that the new 'automation'
> mechanism will call this routine.

Ok, will this routine be merged into 2.4.5 and 2.6.0 ?
If not , then it's not big deal atm since 2.8 will be out at least in one year 
(but DST will change until then ;))) )

Another question: if I call ReReadTimeZone, it'll just do what it's name says, 
next Now() call will return correct result ?

Thanks for your time over this problem.

zeljko

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20111101/6c2ca037/attachment.html>


More information about the fpc-devel mailing list