Am 02.11.2011 17:33, schrieb Hans-Peter Diettrich:
michael.vancann...@wisa.be schrieb:

The call will not be merged. Instead, you can just add

ReadTimezoneFile(GetTimezoneFile);
GetLocalTimezone(fptime);

to your code (and add units 'unix' and 'baseunix').

What will happen if these are called on other platforms, which don't
have timezone files?

As those two functions are implemented in POSIX specific units (Unix and BaseUnix) I expect them to work on all POSIX systems (at least they won't generate a compile time error.

IMO a function (UpdateTimeZone?) should be added, that encapsulates
these POSIX specific calls and dependencies, for use on all platforms.

The solution mentioned above is a workaround for 2.4 where no fix is in place. Newer versions of FPC (maybe even 2.6, I don't know about that) will get an improved/fixed version of Now (how exactly seems to still be debated). Also note that on platforms like Windows this would be a unnecessary call as there the current(!) timezone bias is located in a shared memory area which is mapped into each process by the kernel.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to