> I do not think it is too much asking to an admin to setup the correct
> default timezone in php.ini on install, or to allow users to set it for
> their virtual hosts via the usual interface.

We are not talking only about servers here. We are mainly talking about
personal machines, including laptops of people who travel often. Of
course it is possible to just say that whenever one changes the system
time zone, one should also change the time zone in php.ini. But that
becomes tedious, and if PHP's guessing algorithm works for some people,
why not let them use it?

> It is totally unreliable and has caused so many troubles (and consumed
> many of our debugging time).

I have proposed a couple of improvements, in particular one that could
resolve some DST issues (using tzname to get two abbreviation hints). And
by making it even more explicit that the algorithm performs but a guess,
for example, by moving it to a function with 'guess' in the function
name, bug reports of the sort 'the guess is wrong' can be given a very
low priority if not closed right away. Finally, the unreliability of the
guessing algorithm is exactly why I proposed using system-provided local
time descriptions/APIs.

This issue boils down to: people want software to behave the same way
whichever language it is written in. Things written in Bourne shell,
cmd.exe, C, Perl, Python, Ruby all use the system time zone, or at least
that which was the system time zone when the program made its first call
to a function like localtime. Even MySQL has a time zone called SYSTEM
and uses it by default. PHP is the odd man out: not only does it not use
the system time zone by default, as it instead tries to find one in its
own time zone database that seems most similar, but it is also going to
remove the only ready way to get any close to getting the system time
zone in the next release.

-- 
Oleg

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to