您的位置:首页 > 产品设计 > UI/UE

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to us

2015-10-23 10:14 876 查看
在用date()的时候出现了错误

Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in
G:\CILearning\www\phpstudy.php on line 11



原因是php所取的时间和当地时间有出入,所以导致错误的出现

解决办法:

在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即

<?php

date_default_timezone_set("PRC");

?>就可以了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: