It is not safe to rely on the system's timezone settings. You are *required*
来源:互联网 发布:三菱m70cnc传输软件 编辑:程序博客网 时间:2024/05/16 16:01
这是因为PHP所取的时间是格林威治标准时间,所以和你当地的时间会有出入格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决:
1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即 <?php date_default_timezone_set("PRC"); ?>就可以了(这种方法有个缺点,就是所有的页面都得添加)。
2、在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。
1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即 <?php date_default_timezone_set("PRC"); ?>就可以了(这种方法有个缺点,就是所有的页面都得添加)。
2、在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。
这里选用修改配置文件的方式解决问题:
用sublime_text打开php.ini,
查找“date.timezone”,把语句前的分号去掉,值设置为“PRC”,重启FastCGI服务,问题解决。
最后重启WEB服务器与PHP即可。
阅读全文
1 0
- It is not safe to rely on the system's timezone settings. You are *required*
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to us
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use
- php时间出现Warning: date(): It is not safe to rely on the system's timezone settings. You are *required*
- PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required*
- PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* t
- 安装错误:Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the da
- 解决php It is not safe to rely on the system's timezone settings. You are *required* to use the date.
- "PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You
- PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings
- It is not safe to rely on the system's timezone settings[
- It is not safe to rely on the system's timezone settings
- date(): It is not safe to rely on the system’s timezone settings
- PHP Warning: date(): It is not safe to rely on the system’s timezone settings
- PHP Warning: strtotime(): 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.
- date(): It is not safe to rely on the system's timezone settings
- POJ 2429 GCD & LCM Inverse(大整数素因子分解+二进制枚举)
- Qt网络编程--HTTP服务器(二)
- 依赖注入导致的空指针异常
- Node Web
- 罗技G610:无驱动背光模式调整
- It is not safe to rely on the system's timezone settings. You are *required*
- centos 源码安装 apache2.4
- 测试之美
- OpenGL实现图片边缘暗角效果(1)
- Java ——guava-libraries
- 题目16:矩形嵌套
- Qt网络编程--HTTP服务器(三))
- OkHttp封装类
- 把科学计数法转成字符串