Re: Local time zone
| From: | Derick Rethans | Date: | Mon, 12 Dec 2011 11:36:22 +0000 |
| Subject: | Re: Local time zone | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56883@lists.php.net to get a copy of this message | ||
On Sun, 11 Dec 2011, Oleg Oshmyan wrote:
> * The tzname C variable can be used to get two abbreviations for the
> current zone (typically the standard one and the DST one for zones
> where DST is used), which allows to improve the guess compared to using
> just one abbreviation; for example, the time zone in London in winter
> will be guessed as Europe/London rather than UTC.
It's a guess, and that's the problem. Guessing makes up for odd and
strange bugs if it's not 100% accurate (which it isn't).
> * /etc/localtime is often a symbolic link to or a copy of
> /usr/share/zoneinfo/<time zone identifier>. In this case this time zone
> identifier can be considered another candidate just like the values
> of date.timezone and TZ.
This might work on some distrbutions, but not nearly on all. And
definitely not on Windows. On Debian it's not a symlink for example.
> * This requires more effort, but ideally PHP should just have a special
> time zone named something like 'System' that would use /etc/localtime
> instead of any built-in time zone data, just like the localtime
> C function does when the TZ environment variable is empty.
That's a really bad idea, as we've discussed before on this list.
cheers,
Derick