Warning: Error while sending QUERY packet. PID=5680 in /home/wwwroot/coco/domain/cnlamp/web/wp-includes/wp-db.php on line 1924 Warning: mktime() [function.mktime]: It is not safe to rely on the system’s timezone | LAMP新闻|技巧|经验|资讯站
现在的位置: 首页PHP>正文
Warning: mktime() [function.mktime]: It is not safe to rely on the system’s timezone
发表于7年前 PHP 暂无评论

Warning: mktime() [function.mktime]: 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 ‘UTC’ for ’8.0/no DST’ instead in E:\xampplite\htdocs\j\libraries\joomla\utilities\date.php on line 117 。

这是因为PHP所取的时间是格林威治标准时间,所以和你当地的时间会有出入.格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决:

1.在configuration.php文件的头部添加使用date_default_timezone_set()设置我的默认时区为北京时间,即:

date_default_timezone_set("PRC");
2.还有一个方法就是更改php.ini文件的date.timezone的值为PRC,设置好以后的为:date.timezone=PRC。

给我留言

留言无头像?


×
腾讯微博