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');
?>
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.的更多相关文章
- 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(): ...
- 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 ...
- 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. ...
- 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 ...
- 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 ...
- 出现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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- Java操作memcached(一)
Memcached事实上,两次Hash算法 第一次hash算法被用于定位Memcached示例 第二次hash算法是底部HashMap中间hash算法 Hash算法 1.依据余数 ...
- html5 兼容参考文档 与 浏览器hack兼容参考文档
移动端兼容参考文档 http://mobilehtml5.org/ 浏览器hack http://browserhacks.com/ 附上部分截图
- css Tab选项卡2
注意上述 红色方框 这个是锚点的变相 以及overflow:hiden结合, 利用 锚点对应 id , 也可以实现. 兼容ie6+ 适合手机tab 简单 不需要脚本 其实还可以利用 ...
- 每天一点点java---继承exception类来实现自己的异常类
package prac_1; /** * <p>Title: 捕获异常和实现自己的异常类</p> * <p>Description: 通过继承Exception类 ...
- 轻狂写的桌面日历秀NSIS脚本供大家参考学习
原文 轻狂写的桌面日历秀NSIS脚本供大家参考学习 现在共享桌面日历秀的NSIS脚本,以便交流学习.此脚本实现的功能如下: 7-Zip打开看不到内容.自动读取原安装路径,如果有则不允许更改.取得编译日 ...
- 单机部署redis主从备份
redis为了避免单点故障,也支持主从备份.个人在做主从备份的实验时,因为机器数量有限,一般非常少有多台机器做支撑. 本文就将叙述怎样在一台电脑上实现redis的主从备份. 同一台机器上部署多个red ...
- 敏感字符串加密处理(PHP实现)
/** * 敏感字符串加密处理 * @param $raw_str 原始字符串 * @param $before 前面保留的显示位数 * @param $after 后面保留的显示位数 * @para ...
- 设计模式--模板方法 And State模式
1.模板方法 钩子: 在抽象基类已经有默认的定义,子类选择是否覆盖它 在模板方法模式中, 抽象基类中使用 钩子函数(子类视情况是否覆盖) 来达到控制模板方法中 流程控制的 目的 设计原则: ...
- Java虚拟机类型卸载和类型更新解析(转)
转自:http://www.blogjava.net/zhuxing/archive/2008/07/24/217285.html [摘要] 前面系统讨论过java 类型加载(loa ...
- Linux访问Windows共享文件夹 (转)
在开发Linux程序中,经常会使用Windows的编辑器进行编辑,这样还要拷贝到Linux服务器,如果有这种开发习惯的同学,可以使用这种方式进行开发. 当然除了这种方法之外,可以再Windows安装n ...