现在的位置: 首页 > 综合 > 正文

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone sett

2014年01月08日 ⁄ 综合 ⁄ 共 333字 ⁄ 字号 评论关闭

php的版本较高需要配置php.ini

解决方法

   1:改 php.ini

[Date]

; Defines the default timezone used by the date functions

http://php.net/date.timezone

date.timezone ='Asia/Shanghai'

2:在程序代码中写入

第一行写入date_default_timezone_set ('Asia/Shanghai');

 

php 5.3出这个问题,需要修改php.ini文件 找到date.timezone

将它的改为 date.timezone=utc 将前面的分号去掉,重启服务器

  • 或者在index.php中加上 date_default_timezone_set(‘UTC’);

抱歉!评论已关闭.