PHP date()函数警告: It is not safe to rely on the system解决方法
来源:互联网 发布:出租朋友圈软件 编辑:程序博客网 时间:2024/06/06 12:42
警告代码如下:
PHP 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 gett
ing this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /data0/htdocs/www.qttc.net/function/function.php on line 542
大体是说timezone没有设置,在中国使用的是格林+8小时,所以需要设置一下。
date_default_timezone_set("PRC");
这种方法有个缺点,就是所有的页面都得添加
PHP 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 gett
ing this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /data0/htdocs/www.qttc.net/function/function.php on line 542
大体是说timezone没有设置,在中国使用的是格林+8小时,所以需要设置一下。
第一种
在页面头部加入以下语句
复制代码 代码如下:
date_default_timezone_set("PRC");
这种方法有个缺点,就是所有的页面都得添加
第二种
在php.ini里找到date.timezone这行,把值改成PRC,如date.timezone = PRC。如果没有这一行直接加上就好。最后重启WEB服务器与PHP即可。
阅读全文
0 0
- PHP date()函数警告: It is not safe to rely on the system解决方法
- 解决PHP date调用警告:It is not safe to rely on the system's timezone settings
- 解决PHP date调用警告:It is not safe to rely on the system's timezone settings
- 解决PHP date调用警告:It is not safe to rely on the system's timezone settings
- 解决PHP date调用警告:It is not safe to rely on the system's timezone settings 转载
- php首次使用date函数 遇到警告:Warning:date():It is not safe to rely on the system's timezone settings.You...
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone 错误解决方法
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- 【php】PHP Warning: date(): It is not safe to rely on the system's timezone settings.
- 【php】PHP Warning: date(): It is not safe to rely on the system's timezone settings.
- OpenCV学习之直方图匹配与平面划分
- 7种表格样式
- ubuntu下使用qemu安装虚拟机并配置桥接网络
- 快速幂
- 【图像处理】时域、频域,空间域
- PHP date()函数警告: It is not safe to rely on the system解决方法
- 在Androidstudio中导出项目apk的方法
- HDU1532-Drainage Ditches
- java 多重继承的困境
- 关于前端页面在IE浏览器下无法显示的问题
- PHP的 简介
- ROS学习 之 命名空间(NameSpace)、重映射(Remapping)、名称(Names)
- 卡尔曼滤波 预测与测量我们更应该相信谁?
- MatLab·函数类型