views:

25

answers:

1

Hi,

phpinfo() shows our system to be using ""Olson" Timezone Database Version 2010.3". I think that is now out of date, but can't locate an authoritative location which can confirm that.

(a) Can I update the timezones info for PHP as a whole? (b) If so, how do I update this? I saw the instructions at http://www.electrictoolbox.com/correct-php-timezone/ where it says that, after installing the appropriate module, it says I have to:

You should add "extension=timezonedb.so" to php.ini

Do we need to do that? Shouldn't PHP be automatically using the correct file?

A: 

Hi, as far as I know the Timezone DB (TDB) is distributed within PHP itself. Because of that the timezone DB becomes obsolete after some time and you should either update PHP or the TDB to reflect the changes in TDB.

There's a PECL extension which releases new TDB packages which you can download and install and use them in your old PHP installations.

I'm not aware there's a way to update TDB directly in PHP. The PECL extension was created to target this issue.

dwich
Hi dwich - are you indicating that if we update PHP itself that should work as well? I would have thought PHP updates are few and far in-between...
tzmatt7447
As regarding PECL - Im' not too familiar with the concept - is this a standard built-in part of PHP now?
tzmatt7447
@tzmatt7447: If you update PHP, it might contain newer version of TDB, but you can't be sure it's the newest one. There can also be new releases of TDB between regular releases of PHP so again - you can't be sure if you update PHP you'll get the newest TDB and - PHP will not be released just because TDB was updated.
dwich
I'm not a PECL expert, if you want to try it, search for information about installing it to your OS. We use FreeBSD and the installation is as simple as this (pseudo command): `pkg_install pecl-timezonedb`. Then restart Apache and you're done.
dwich