How to update timezonedb in PHP (updating timezones info)?

tzmatt7447 picture tzmatt7447 · Aug 25, 2010 · Viewed 21.3k times · Source

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?

Answer

dwich picture dwich · Aug 25, 2010

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.