PHP date.timezone问题

在练习的过程中,遇到下面的报错信息。

访问页面中提示:

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

具体解决方法:

修改php.ini配置文件

在php.ini配置文件中找到:  ;date.timezone = ,把前面的分号去掉在 “=”后面加上时区。

date.timezone = "Asia/Shanghai"

扫描二维码关注公众号,回复: 1723583 查看本文章

或者

date.timezone="Asia/Chongqing"

修改完后,重启apache即可。

猜你喜欢

转载自blog.csdn.net/qq_35343446/article/details/79439464
今日推荐