Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to us
2015-10-23 10:14
876 查看
在用date()的时候出现了错误
Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in
G:\CILearning\www\phpstudy.php on line 11
原因是php所取的时间和当地时间有出入,所以导致错误的出现
解决办法:
在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即
<?php
date_default_timezone_set("PRC");
?>就可以了。
Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in
G:\CILearning\www\phpstudy.php on line 11
原因是php所取的时间和当地时间有出入,所以导致错误的出现
解决办法:
在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即
<?php
date_default_timezone_set("PRC");
?>就可以了。
相关文章推荐
- android 中UID与PID的作用与区别
- No usable Android build tools found. Highest installed version is xx; minimum version required is 19
- [OrangePi] Building the system
- ./configure -build,-host,-target设置
- request获取前台表单
- [转载] 为 Key-Value 数据库实现 MVCC 事务
- BIOS设置之UEFI/Legacy BIOS切换图文详解
- UEFI+GPT引导实践篇(二):UEFI引导安装64位Win7/Win8
- UEFI+GPT引导实践篇(一):切换到UEFI启动,准备安装介质
- UEFI+GPT引导基础篇(一):什么是GPT,什么是UEFI?
- Flash Builder4.7 更新Air SDK及FlashPlayer
- Android Call requires API level 11 (current min is 8)的解决方案
- easyUI dialog弹出时适应页面大小
- switch()出现警告warning:enumeration value ‘xxx’ not handled in switch
- keyboard和 UITextFiled 之间的处理
- iOS 9 学习系列:UIKit Dynamics
- UI第二天总结
- UI第一天学习总结
- RMAN-07540: Cleanup is required for the VPC user schema
- QT GUI总结