在写php程序中有时会出现这样的警告:
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 getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in D:\PHPWEB\news\file.php on line 17 。这是因为PHP所取的时间是格林威治标准时间,所以和你当地的时间会有出入格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决:
1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即 <?php date_default_timezone_set("PRC"); ?>就可以了。
2、在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。

It is not safe to rely on the system's timezone settings相关推荐

  1. PHP Warning: date(): It is not safe to rely on the system's timezone settings

    在用PHP5.3以上的PHP版本时,只要是涉及时间的会报一个 "PHP Warning: date() [function.date]: It is not safe to rely on ...

  2. 解决php的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. You are *required* to use ...

  3. php : Warning: strftime(): It is not safe to rely on the system's timezone settings.

    使用 Smarty 的时候出现这种警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. ...

  4. PHP Warning: 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. You are *requir ...

  5. 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. Y ...

  6. php echo输出多了 date(): It is not safe to rely on the system‘s timezone settings

    原因 如果使用PHP5.3以上版本时,如果没有正确的配置php.ini就会出现PHP日期函数的错误.以前很多旧的PHP编程教程没有说到这个问题,所以不少读者会觉得困惑,下面笔者为大家讲述解决这个问题的 ...

  7. php Warning: phpinfo(): It is not safe to rely on the system's timezone settings.解决方法

    安装php后,使用phpinfo();查看信息,有Warning: phpinfo(): It is not safe to rely on the system's timezone setting ...

  8. PHP Warning: date(): It is not safe to rely on the system's timezone settings.

    OSSEC安装结束后运行,运行以下命令却抛错 cat /opt/ossec/logs/alerts/alerts.log 具体抛错内容: ** Alert 1468897672.2164786: ma ...

  9. 问题解决:Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You.

    在我们使用到时间函数data()时,有时候会弹出下面这种错误: "PHP Warning: date() [function.date]: It is not safe to rely on ...

最新文章

  1. ajax更新,AJAX网址更新(AJAX URL update)
  2. a - 数据结构实验之串一:kmp简单应用_中高级面试必备:快速入门数据结构和算法
  3. GridView如何设置View的初始样式
  4. pat 1025 反转链表
  5. PDF.js如何添加放大缩小的功能,转换成图片应该如何实现?
  6. [VJ][bfs]Catch That Cow
  7. android自定义选年控件,Android精美日历控件CalendarView自定义使用完全解析
  8. php try 错误_PHP异常和错误(2)异常的基本处理:try
  9. 解决笔记本没有COM端口导致无法用SecureCRT或者超级终端配置交换机
  10. 决策支持系统(DSS)介绍
  11. 在EXCEL中生成服从三角分布随机数的方法
  12. 北京IMAX影院全攻略
  13. 【原创】使用高德 API
  14. 用MATLAB对语音进行基频搬移,语音信号变声处理系.doc
  15. 卢松松博客模板php版,[Emlog模板]卢松松博客主题
  16. 基音周期检测acf算法及matlab仿真,基音周期检测算法研究及在语音合成中的应用...
  17. 中产学院全国首创7大黄金技术桂林游学发布会
  18. App中的微信支付和支付宝支付如何实现
  19. 三体船的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告
  20. 油猴脚本 from greasyfork

热门文章

  1. 3种mysql的储存机制_MySQL三种InnoDB、MyISAM和MEMORY存储引擎对比
  2. python和anaconda的区别_anaconda和python区别
  3. php ci 调用控制器,如何从Codeigniter中的另一个控制器加载一个控制器?
  4. c oracle long raw,初次用Oracle,不会用Long Raw类型,请大家帮忙看看
  5. java如何生成唯一码_java – 如何为方法实例生成唯一的哈希码?
  6. mysql临时开启二进制_关于MySQL二进制日志Binlog的认识
  7. 初识Redis,看这一篇就够了
  8. opencv数字图像处理(图像模糊)
  9. 数据结构和算法:(3)3.1线性表的顺序存储结构
  10. excel求和为什么是0_Excel教程:小小的N函数竟如此厉害