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 ...
随机推荐
- asp.net mvc实现rest风格返回json
实现类似:http://localhost:1799/rest/person/1方式返回一个json内容: 在asp.net mvc中新建一个control rest,然后在其中新增方法: publi ...
- CloudFoundry.yml修订
--- name: CFRELEASE02 director_uuid: fdd46e30-f2c5-41dc-9662-0976fdac5716 releases: - name: cf versi ...
- Android使用SVG矢量创建很酷的动态效率!
尊重原创,欢迎转载.转载请注明: FROM GA_studio http://blog.csdn.net/tianjian4592 一个真正酷炫的动效往往让人虎躯一震,话不多说.咱们先瞅瞅效果: ...
- CORS
CORS(跨域资源共享) 前言:上一篇文章提到使用JSONP实现跨域请求的时候,偶然间提到CORS,即Cross-Origin Resource Sharing(跨域资源共享).虽然前些天也看了一下, ...
- Android定调的发展
首先,介绍一下Android系统支持的铃声格式. 有下面几种: 64赫兹Midi,AAC.AAC+.AMR.WAV.MP3.Real Audio.WMA.OGG等格式. 将音频文件设置成铃声非常eas ...
- [Django1.6]The MEDIA_ROOT and STATIC_ROOT settings must different 解决
该项目有一个图片上传功能,为了把上传路径很简单,写在同一个静态文件路径,于wi7执行机器上没问题,今centos我们报道了机上,如下面的错误: django.core.exceptions.Impro ...
- Lucene于Directory
MMapDirectory从继承FSDirectory,抵抗jre至今未能解决Mmap close不回收空间(直到full gc恢复之前,)的bug,lucene使用hack资料恢复(只要sun ja ...
- 基于低压电力采集平台DW710C的基础开发
实验课题 (1)自己定义通信规约,採用java或C++编写简单的PC端上位机软件,实现採集器与PC机的通信.实验可在DW710C-PCproject下进行. (2)实现LCD显示字符.数字.汉字和简单 ...
- android 有效载荷大图,避OOM
我们的项目往往会载入图片.有时,承担太多,再装图片,它导致了非常小的程序卡,而在铅oom从而导致异常app再见,今天翻译google官方网站,它已经做了很好的图像处理汇总,由于Google我们已经给解 ...
- from声明
在整个应用程序,只有三行声明.这是最短单WIN32应用,但它的功能是非常有限,简单地显示一个消息框,示出来,其他什么事情也没有做.以下就来分析这三行语句了.别小看这三行语句.其实是隐藏着非常多知识点在 ...