有三种解决办法:

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. web前端知识体系小结(转)

    1. 前言 大约在几个月之前,让我看完了<webkit技术内幕>这本书的时候,突然有了一个想法.想把整个web前端开发所需要的知识都之中在一个视图中,形成一个完整的web前端知识体系,目的 ...

  2. Codeforces Round #261 (Div. 2) E. Pashmak and Graph DP

    http://codeforces.com/contest/459/problem/E 不明确的是我的代码为啥AC不了,我的是记录we[i]以i为结尾的点的最大权值得边,然后wa在第35  36组数据 ...

  3. Java操作memcached(一)

    Memcached事实上,两次Hash算法    第一次hash算法被用于定位Memcached示例    第二次hash算法是底部HashMap中间hash算法 Hash算法      1.依据余数 ...

  4. Unity3d 导入图像尺寸失真解决方案

    导入到unity3d内的图像被默认长宽变换为满足2^n关系. 例如以下图,我有张图片名称为984plus598表示我尺寸为984*598.拷贝到unity3d中后的大小为1024*512 方法一: 在 ...

  5. datatable1.9 与datatable1.10以数据差异

    我还探讨datatable1.10新用途,如果在下面的代码中的错误,欢迎.. 1.10与1.9解释官方网站之间的差异:http://www.datatables.net/upgrade/1.10 看代 ...

  6. android利用jdk制作签名

    Apk签名首先要有一个keystore的签名用的文件. keystore是由jdk自带的工具keytool生成的.详细生成方式參考一下: 開始->执行->cmd->cd 到你安装的j ...

  7. 使用 Visual Studio 对exe文件进行数字签名

    使用"VS2013 开发人员命令提示"运行签名工具.转到要签名的文件目录运行命令: signtool sign /a 要签名的程序.exe signtool 的相关命令 Usage ...

  8. Hadoop 它们的定义Writable NullpointerException

    Hadoop周边环境:Hadoop2.4 定义中的Hadoop的Writable时间,有时你需要使用数组,而不是简单的单一值或串.例如,下面的代码: package test; import java ...

  9. C++实现链表

    最后几天留在Intel,没什么事情,都是开开会.趁着闲功夫,把数据结构复习一下,写了一个list.时间仓促,有些地方考虑的可能没那么到位,望高手们指点. #include <iostream&g ...

  10. 于XAML导入命名空间的代码

    例如,下面的代码到指定的命名空间.不仅导入的命名空间,并且还为指定的命名空间前缀local.当然,你也可以指定一个前缀为另一个名称,这可以定义.导入后,市民可以在命名当前空间XAML使用代码.例如,在 ...