使用 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. Warning: strftime(): It is not safe to rely on the system's timezone settings.

    当运行程序时,会出现如下警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. You a ...

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

    当运行一些程序时,在httpd日志中会有如下警告日志: PHP Warning:  strftime(): It is not safe to rely on the system's timezon ...

  3. [服务器时区问题]PHP Warning: strftime(): It is not safe to rely on the system's timezone set

    PHP Warning: strftime(): It is not safe to rely on the system's timezone set 当运行一些程序时,在httpd日志中会有如下警 ...

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

  5. php时区设置 warning: strtotime(): It is not safe to rely on the system's timezone settings

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

  6. 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* t ...

  7. 出现Warning: 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 ...

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

    有三种解决办法: 1. php文件中设置时区 <?php date_default_timezone_set('Asia/Shanghai'); echo strtotime('2012-9-3 ...

  9. PHP Warning: phpinfo(): It is not safe to rely on the system's timezone setting

    错误描述: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *re ...

随机推荐

  1. MVVM与Backbone demo

    MVVM https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel

  2. mongo3.2

    arbiter配置文件 processManagement: fork: true net: bindIp: 172.16.10.1,127.0.0.1 port: storage: dbPath: ...

  3. Computop支付网关(一) credit Card

    1.界面没有中文,只能选择英文 sp – Spanish; en – English; ca – Catalan; fr – French; de – German; du – Dutch; it – ...

  4. IOS遍历方式

    NSArray* arrays = @[@"1",@"2",@"3",@"4",@"5",@&quo ...

  5. AjaxStudyNote

    AjaxStudyNoteBy:Silvers:(E:\Video_Tutorials\Java自学视频\尚硅谷JavaEE培训\6WEB基础-Ajax)15:02 2016/2/29什么是AjaxA ...

  6. 最好的cpm广告联盟哪里有

    最好的cpm广告联盟哪里有,58传媒广告联盟还要提醒众位站长的是网站在经营发展中必须最大化的扩展自己的优势力量.每个网站都有属于自己的优势魅力,这些优势特点只有得到最大化的发挥才能为网站带来意想不到的 ...

  7. 5.开发webservice

    package com.atguigu.ws; import javax.jws.WebMethod; import javax.jws.WebService; /** * * @author Adm ...

  8. docker 介绍

    docker 介绍 安装 sudo apt-get install docker.io sudo docker info 查看是否安装成功 hello world sodu docker run he ...

  9. 霍尼韦尔FC400A与FC400B的区别

    给霍尼韦尔官方打电话咨询了下,发现两者区别不大,唯一的区别是400B可以和主机联动,也就是主机关的时候,400B也可以自动关闭,不需要手动去关闭电源,这样非常方便. 本来官方是只有400A的时候,但是 ...

  10. PhpStorm创建Drupal模块项目开发教程(2)

    通常支持Drupal HOOK的文件为.module.首先我们需要在这里对它进行声明,以便索引,并且在代码完成中使用Ctrl+Space(空格)完成HOOK实现. Drupal HOOK调用,通常情况 ...