首页 > Web开发 > 详细

php date("Y-m-d H:i:s") 出现警告信息

时间:2015-12-04 10:41:35      阅读:369      评论:0      收藏:0      [点我收藏+]

使用:

$createtime=date("Y/m/d H:i:s", time()+16*60*60);

$createtime=date("Y-m-d H:i:s");//时间。。H表示24小时制

提交表单后出现如下错误提示:

Strict Standards: date() [function.date]: It is not safe to rely on the system‘s timezone settings. Please use the date.timezone setting, the TZ environment variable 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 C:\AppServ\www\www\phpsql\check_add.php on line 11

 

解决方法:

方案1:check_add.php头部:<?php date_default_timezone_set("PRC");  ?>  设置默认时区为北京时间。。解决当前页面。

方案2:在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。

   解决所有页面使用时间的问题。

 

php date("Y-m-d H:i:s") 出现警告信息

原文:http://www.cnblogs.com/yuzhongwusan/p/5018391.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!