How to update timezonedb in PHP (updating timezones info)?(如何在 PHP 中更新 timezonedb(更新时区信息)?)
问题描述
phpinfo() 显示我们的系统正在使用Olson"时区数据库版本 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?
推荐答案
据我所知,Timezone DB (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(更新时区信息)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 PHP 中更新 timezonedb(更新时区信息)?


- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- Laravel 仓库 2022-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01