小疑问当我php.ini没有设置
date.timezone = "Asia/Chongqing"
这样的时区时候,运行yii会有这样的报错
“date() [<a href='function.date'>function.date</a>]: 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”
解决的办法有
1》在php.ini 文件中添加
date.timezone = "Asia/Chongqing"
2》或者 php;中处理代码时候 需要 echo gmdate('Y-m-d H:m:s', time()+8*3600);
3》date_default_timezone_set("Asia/Shanghai");
问题1.
我想问一下yii的main.php文件中的数组
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'blog',
'defaultController'=>'post',)
有没有关于时区的设置,效果如 date_default_timezone_set()
- 关于main.php数组中所有的参数有没有一篇完整的文章,可以统一介绍一下。若有请发一下连接,也许我没有找到其地址。
目前我看到现象是十分的零散。例如:当介绍URL Management 他才引出需要如下设置
'components'=>array(
…
'urlManager'=>array(
'urlFormat'=>'path',
),
),