使用 Smarty 的时候出现这种警告:

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

解决办法: 设置时区

方法1:

(最好的方法)在php.ini里加上找到date.timezone项,设置date.timezone = "Asia/Shanghai",重启环境就ok了。

方法2:

在需要用到这些时间函数的时候,在页面添加date_default_timezone_set("PRC");

方法3:

在页头加上设置时区ini_set('date.timezone','Asia/Shanghai');

ps:

http://beikeit.com/post-682.html

php : Warning: strftime(): 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

    如下错误: PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *requir ...

  2. 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 ...

  3. 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 ...

  4. 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 *req ...

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

  6. Warning:It is not safe to rely on the system's timezone settings

    今天在本地运行PHP脚本文件没有问题,但是传到线上测试服务器以后,报了如下错误:<b>Warning</b>: date() [<a href='function.dat ...

  7. 解决php报错Warning: date(): It is not safe to rely on the system's timezone settings

    只需要在php里面加入下面一句代码即可: date_default_timezone_set("PRC"); 这个是设置时区的意思.

  8. 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 ...

  9. 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 ...

最新文章

  1. 计算机的存储系统,全方面、最详细
  2. 使用***搭建javaweb环境
  3. 文计笔记7:HTML与CSS
  4. 划分VLAN,根据每个VLAN通过DHCP分配IP地址
  5. Eclipse里如何指定目标JRE版本
  6. 如何在SQL Server中创建视图
  7. [转]git merge 与 git rebase的区别
  8. MFC用户界面设计 一
  9. 以后华为鸿蒙也要越狱了,华为EMUI升级鸿蒙后依然可使用太极运行 Xposed 提供多款型号升级...
  10. QA视角看数据匿名化
  11. 机器视觉 计算机专业,机器视觉属于什么专业
  12. 计算机本科考金融本科自考,金融专业自考本科考哪几门,自考金融本科科目学习考试顺序?...
  13. 赛马问题(30匹马,5个跑道,比赛多少次可以分出前三名)
  14. 抽奖随机滚动_老板让我做年会抽奖系统,我用Excel制作内定抽到自己的大奖!...
  15. 股票策略:A股三季度配置偏向成长股
  16. 低学历逆袭难,真的只是不够努力吗?
  17. wxpython的简单使用【代码实现】
  18. 后端服务器常用软件:nginx
  19. 六、 rewrite的使用
  20. ITextpdf将Markdown转换成PDF详细流程(HTML转PDF)

热门文章

  1. linux etc/init 与etc/init.d的区别
  2. kafka专题:kafka的Topic主题、Partition分区、消费组偏移量offset等基本概念详解
  3. mybatis逆向工程生成的xxxExample实例详解
  4. MySQL的MVCC底层原理二
  5. centos 安装openoffice (办公软件 WPS)
  6. Jquery实现无限级树状结构并动态添加增删改等编辑功能
  7. linux makefile详解
  8. @AspectJ中的切点表达式详解
  9. netty发送对象消息
  10. 2018年Java展望