Re: time zone ignored (both via ini or in code)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 2, 2010 at 12:29 AM, Nathan Nobbe <quickshiftin@xxxxxxxxx> wrote:
> a few thoughts,
> 1. set error_reporting to E_ALL to see if the engine is trying to tell you
> something you may be overlooking


Sorry, failed to mention that I did this, and it says nothing.


> 2. for grins, maybe see if the TZ environment variable is set on your system
>     var_dump(getenv('TZ'));


I didn't post the phpinfo() output originally but had checked and no,
TZ isn't set.


> 3. another test would be to set date.timezone to something else and see if
> date_default_timezone_get() returns that new value, which would indicate
> it's falling through to the third option in the precedence chain.


AHA!

I had tried checking validity by setting a BOGUS time zone (which
showed that it was taking effect), but I had not tried checking by
setting an alternate VALID time zone.

Guess what? It works. If I set it to America/Denver, I get correct output.

Thus, something is corrupt in the timezone DB itself (which I believe
is internal to PHP from what I understand from the threads I've read).

America/Chicago is completely broken but America/Denver works just fine.

Incidentally, I have noticed that CentOS is completely broken in their
tz distro. Every time it updates, it includes a US/Central file that
is completely invalid. This has persisted for months--at the OS level
I've fixed it by copying in a valid US/Central file from another box.
But doing that does not fix PHP (tried that just now)--which again I'd
expect it not to anyway, since I believe PHP (as of PHP5) has an
internal timezone DB. But I tried it just in case.

So now I suppose the thread becomes: how do I get a valid US/Central
(America/Chicago) timezone in PHP5?

Thanks much,
Dan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux