PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required*
2015-06-29 13:56
489 查看
PHP Warning: Unknown: 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 'Asia/Chongqing' for 'CST/8.0/no DST' instead in Unknown on line 0
这个错误的原因是PHP没有设置时区, 所以解决方案很简单
方法一:
在页头使用date_default_timezone_set()设置 date_default_timezone_set('PRC'); //东八时区 echo date('Y-m-d H:i:s');
方法二:
在页头使用 ini_set('date.timezone','Asia/Shanghai');
方法三:
修改php.ini。打开php5.ini查找date.timezone 去掉前面的分号修改成为:date.timezone =PRC
详细请查看这里:http://www.cnblogs.com/jenry/archive/2011/01/21/1941497.html
相关文章推荐
- Android UI 实现表格布局
- 警告: Multiple build commands for output file
- Ant build.xml 批量打渠道包 加混淆功能
- require(),include(),require_once()和include_once()区别
- ios UIBarButtonItem rightBarButtonItem Title 设置不了
- Android UI学习心得(三)
- UITableView实现Cell的滑动删除
- require.js 最佳实践
- android ios UI
- Android Juint环境配置
- iOS 设置状态栏颜色(UIStatusBar)
- 《Java程序设计》第16周周四:GUI编程及文件对话框的使用~作业
- 严重: Unable to set localhost. This prevents creation of a GUID. Cause was: cloud: cloud
- 安卓ui线程优先级
- im2uint8函数分析
- Direct3D 12 Programming Guide
- UEditor插入视频、图片显示问题解决
- ios之UIControl
- Double类parseDouble和valueOf方法的区别
- Android UI学习(二)