如何更新PHP中的timezonedb(更新时区信息)? [英] How to update timezonedb in PHP (updating timezones info)?

查看:816
本文介绍了如何更新PHP中的timezonedb(更新时区信息)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

phpinfo()显示我们的系统正在使用OlsonTimezone数据库版本2010.3。我认为现在已经过时了,但找不到可以确认的权威性位置。

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)我可以更新吗PHP的整个时区信息?
(b)如果是,我该如何更新?我看到 http://www.electrictoolbox.com/correct-php-timezone/ 它说,在安装相应的模块后,它说我必须:

(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

我们需要这样做吗?不应该PHP自动使用正确的文件?

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

推荐答案

据我所知,时区数据库(TDB)分布在PHP本身。因为时区数据库在一段时间后变得过时了,您应该更新PHP或TDB来反映TDB的变化。

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.

有一个PECL扩展,它会发布新的TDB您可以在旧的PHP安装中下载并安装并使用它们的软件包。

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

我不知道有一种方法可以在PHP中直接更新TDB。创建PECL扩展名是为了解决这个问题。

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

这篇关于如何更新PHP中的timezonedb(更新时区信息)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆