有三种解决办法:

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. bootstrap使用汇总

    //大多数功能都能够指定data属性来指定 但是,有必要的情况下使用jquery由于事件是不同的过程 //活动通常有两种状态show shown 通用和过去的 <!DOCTYPE html> ...

  2. JNDI-j2ee

    Database Connection Pool (DBCP) Configurations The default database connection pool implementation i ...

  3. 对于C11中的正則表達式的使用

    Regular Expression Special Characters "."---Any single character(a "wildcard") & ...

  4. lsblk请参阅块设备

    lsblk可以查看分区和挂载的磁盘使用情况 lsblk全部的參数 -a, --all            显示全部设备  -b, --bytes          以bytes方式显示设备大小  - ...

  5. Net并行编程高级教程--Parallel

    Net并行编程高级教程--Parallel 一直觉得自己对并发了解不够深入,特别是看了<代码整洁之道>觉得自己有必要好好学学并发编程,因为性能也是衡量代码整洁的一大标准.而且在<失控 ...

  6. 打印到类阵列的给定序列的所有排列的n皇后问题

    题目例如以下:Given a collection of numbers, return all possible permutations. For example, [1,2,3] have th ...

  7. 024找到二维阵列(keep it up)

    剑指offer在标题中:http://ac.jobdu.com/problem.php? pid=1384 题目描写叙述: 在一个二维数组中,每一行都依照从左到右递增的顺序排序.每一列都依照从上到下递 ...

  8. myeclipse解决JSP文件script调整背景颜色

    1进口MyEclipse主题后,打开jsp要么html文件,jsvascript部分原因遭遇了一层白色的.闪避这个时候.症状,如下面: watermark/2/text/aHR0cDovL2Jsb2c ...

  9. JAVA解决大数

    主题链接:CLICK HERE~ 有了Java求解大数变得如此简单,以后再也不用操心大数模板了.哦啦啦啦. import java.math.BigInteger; import java.math. ...

  10. 线程池ThreadPoolExecutor使用简介(转)

    一.简介 线程池类为 java.util.concurrent.ThreadPoolExecutor,常用构造方法为: ThreadPoolExecutor(int corePoolSize, int ...