程序迁移到 PHP 5.3 后使用date()函数报错

2012/10/14 11:12
阅读数 62

Warning: 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 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /www/xxx.php

2个解决方法:

1、在使用date()前加入: date_default_timezone_set('Asia/Chongqing');

2、在php.ini中设置 date.timezone = "Asia/Chongqing"

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部