有三种解决办法:

1. php文件中设置时区

<?php

date_default_timezone_set('Asia/Shanghai');

echo strtotime('2012-9-3');

?>

2. 设置php.ini

data.timezone = "Asia/Shanghai"

3. 设置date_timezone.ini

date.timezone = "Asia/Shanghai"

如果使用zend server ,在 Server Setup -> Directives -> date.timezone 设置成Asia/Shanghai 。

然后点击Save Changes, Restart PHP

对应的时区参考:timezones

PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.的更多相关文章

  1. 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(): ...

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

  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.

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

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

  6. 出现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 ...

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

    PHP调试的时候出现了警告: 问题: Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You ...

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

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

随机推荐

  1. (hdu step 7.1.5)Maple trees(凸包的最小半径寻找掩护轮)

    称号: Maple trees Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tot ...

  2. java major version(转)

    在jar包中,用winrar解压一个类文件,然后在命令行下面输入 javap -verbose classname 会输出一些信息,大致如下: Compiled from "HtmlCraw ...

  3. SQL Server 移动数据库

    原文:SQL Server 移动数据库 移动系统数据库在下列情况下可能很有用: 故障恢复.例如,数据库处于可疑模式下或因硬件故障而关闭. 计划的重定位. 为预定的磁盘维护操作而进行的重定位. 下列过程 ...

  4. SWTBOK实践测试系列(2) --您将提交测试开发者版本号打回来了?

    开发商斗争非常多晚,提交测试的最终版本. 它们可以缓和.但噩耗传来很快,软件没有通过预测试测试团队(为了确保在测试过程,开发者提交的代码验证的基本功能或业务流程).开发王经理.快速找到负责预测试试验张 ...

  5. NSIS:检查某注册表键是否存在

    原文NSIS:检查某注册表键是否存在 ;定义注册表主键!define HKEY_CLASSES_ROOT           0x80000000!define HKEY_CURRENT_USER   ...

  6. 海哥:T2C时代的到来了,那么什么叫T2C?

    昨天写了一篇文章叫做<我为什么选择家具行业,以及T2C概念的创办>,地址:http://user.qzone.qq.com/198819880/blog/1414399801 ,里面提到了 ...

  7. SSH-Struts(三)—ActionForm

    ActionForm ActionForm用于封装用户的请求数据.即用户在页面上输入的数据.它充当了一个运输工具的角色.为了能够立体的理解ActionFrom.以下从两个角度看看:     从封装的数 ...

  8. 什么是WEBserver? 经常使用的WEBserver有哪些?

    什么是WEBserver? 经常使用的WEBserver有哪些? 一.什么是WEBserver Webserver能够解析HTTP协议.当Webserver接收到一个HTTP请求,会返回一个HTTP响 ...

  9. AngularJS html5Mode与ASP.NET MVC路由共存

    前言 很久之前便听说AngularJS,非常酷,最近也比较火,我也在持续关注这个技术,只是没有认真投入学习.前不久公司找我们部门做一个OA系统(想省下几万大洋的费用),第一时间便想到AngularJS ...

  10. XML概要

     早在两年前,我一直听说XML,但是,只是没有时间去研究它.也不知道它的作用,花了一些时间最近几天来学习他们的语言.是XML的一些简介希望能对各位同学有所帮助: XML是eXtensible Ma ...