YII错误date()

有一段实际没有用yii啊, 记得当初用的时候还是1.1.4,现在都1.1.7了,今天架了一下,准备开始一个自己的项目,结果刚通过yiic webapp webroot搞定了第一步,修改yii framework 位置之后,准备进入index看看效果,结果不是之前熟悉的首页,给了我一个页面

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 ‘UTC’ for ’8.0/no DST’ instead

不过还是不错的,直接给我输出了错误提示,原来是时区没有设置导致的这个问题。

在index.php文件头部添加

/*
 * 此处设置时区,修正出现的echo date(‘Y’);报错
 */
date_default_timezone_set(“PRC”);

再次进入,Ok,问题解决,出现了熟悉的界面。贴出来,希望对大家有帮助

标签:
本文连接地址: http://www.fresker.com/old2/archives/365 (转载注明出处)

回复

目前暂无评论

Sorry, 评论已关闭.