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 ...
随机推荐
- leetcode第一刷_Spiral Matrix II
跟上一题的策略全然一样,这个题是要求保存当前增加的是第几个数,由于矩阵里面存的就是这个东西. 我有尝试想过是不是有一种方法能够直接推算出每一行的数据是哪些.但没过多久就放弃了.这样的方法尽管能够避免在 ...
- SVN与eclipse整合和利用、SVN与Apache综合
SVN与eclipse综合 下载SVN插入(http://subclipse.tigris.org) http://subclipse.tigris.org/servlets/ProjectDocum ...
- ruby 删除文件夹(包括文件夹中的文件夹和文件)
def deleteDirectory(dirPath) if File.directory?(dirPath) puts "是文件夹"; Dir.foreach(dirPath) ...
- 理解git经常使用命令原理
git不同于类似SVN这样的版本号管理系统,尽管熟悉经常使用的操作就能够满足大部分需求,但为了在遇到麻烦时不至于靠蛮力去尝试,了解git的原理还是非常有必要. 文件 通过git管理的文件版本号信息所有 ...
- Android.9图片评论(一个)
什么是.9图片 至于什么是.9图片这里就简单提一下,即图片后缀名前有.9的图片,如pic.9.png.pic1.9.jgp,诸如此类的图片就称为.9图片. .9图片的作用 ①.9图片的作用是在图片拉伸 ...
- 彩色图像--色彩空间 CMY(K)场地
得知DIP文章63日 转载请注明文章出处:http://blog.csdn.net/tonyshengtan .出于尊重文章作者的劳动,转载请标明出处!文章代码已托管.欢迎共同开发:https://g ...
- (大数据工程师学习路径)第三步 Git Community Book----Git基本用法(上)
一.git的初始化 1.Git 配置 使用Git的第一件事就是设置你的名字和email,这些就是你在提交commit时的签名. $ git config --global user.name &quo ...
- C 这些东西的内存管理
一.内存介绍 本文主要介绍C内存管理基本概念,以及C语言编译后的可执行程序的存储结构和执行结构. 在用户存储空间,一个C程序的在内存中的分配分类5大部分:代码段.全局已初始化数据段.bss段.堆和栈. ...
- freemarker定义自己的标签错误(一)
freemarker定义自己的标记 1.错误描写叙述 freemarker.core.ParseException: Token manager error: freemarker.core.Toke ...
- js中document.write()使用方法
<script> var hrf = window.location.href; if(hrf.indexOf('change')>0){ ...