加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PHP date.timezone警告

发布时间:2020-12-13 13:55:22 所属栏目:PHP教程 来源:网络整理
导读:我一直收到这个错误: Message: date() [function.date]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those m
我一直收到这个错误:

Message: date() [function.date]: It is not safe to rely on the
system’s timezone settings. You are required to use the
date.timezone setting or the date_default_timezone_set() function. In
case you used any of those methods and you are still getting this
warning,you most likely misspelled the timezone identifier. We
selected ‘America/New_York’ for ‘EST/-5.0/no DST’ instead

我编辑了我的php.ini并将其添加到它的末尾:date.timezone =“America / New_York”

保存php.ini并重新启动Apache后,我仍然收到错误.我也试过重启整个服务器无济于事.

我在CentOS 5.6上运行cPanel / WHM,如果这有任何区别的话.此外,PHP处理程序是suphp.

我不确定接下来会尝试什么…任何指导?

打开相应的php.ini文件并添加以下内容,将时区替换为适合您的时区(时区名称列表 – http://php.net/date.timezone):
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Chicago"

更多细节:

http://forums.modx.com/thread/33294/solved-warning-strtotime-function-strtotime-in-evo-1-01-on-php-5-3-0

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读