Re: Local time zone
| From: | Oleg Oshmyan | Date: | Wed, 14 Dec 2011 23:10:41 +0000 |
| Subject: | Re: Local time zone | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56929@lists.php.net to get a copy of this message | ||
> <time.h> is present in *nix, Windows, and probably everywhere php runs.
> As it provides mktime/gmtime/localtime, it should be possible to
> portably deal with timezones.
> At least when it's not multithreaded.
PHP internally already has php_localtime_r and php_gmtime_r in
main/php_reentrancy.h, implemented in main/reentrancy.c, and they are
already used in various places in the code, including the guessing
algorithm that is being removed in PHP 5.4. So at the very least
thread-safety (and in fact portability too) should not become worse than
it is now.
> And if the host doesn't contain timezone data (embedded systems,
> perhaps), that "System" zone could simply default to UTC.
Sounds good.
--
Oleg