PHP Warning: date() [function.date]: It is not safe to rely on the system‘s timezone
问题描述:
PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone settings.You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in
原因分析:
date.timezone默认是格林威治标准时间(GMT),如果timezone设置不正确,每次调用时间函数时,都会产生E_NOTICE 或者 E_WARNING 信息。解决此问题,需将时区设置为本地所在时区。
解决方案:
- 方法一:在页头使用date_default_timezone_set()设置
date_default_timezone_set('PRC'); //东八时区
- 方法二:在页头使用
ini_set('date.timezone','Asia/Shanghai');
- 方法三:修改php.ini配置文件(修改保存后,需重启apache)。找到“;date.timezone”修改成
date.timezone = Asia/Shanghai
原文地址:
https://blog.csdn.net/jordanmicle/article/details/83671031
PHP Warning: date() [function.date]: It is not safe to rely on the system‘s timezone相关推荐
- 问题解决:Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You.
在我们使用到时间函数data()时,有时候会弹出下面这种错误: "PHP Warning: date() [function.date]: It is not safe to rely on ...
- PHP Warning: date(): It is not safe to rely on the system's timezone settings
在用PHP5.3以上的PHP版本时,只要是涉及时间的会报一个 "PHP Warning: date() [function.date]: It is not safe to rely on ...
- PHP Warning: date(): 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. You are *requir ...
- Warning: date() :It is not safe to rely on the system's timezone settings
在执行php文件时会出现下面的错误: PHP Warning: date(): It is not safe to rely on the system's timezone settings. Y ...
- 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
运行php文件报错如下: Warning: date(): It is not safe to rely on the system's timezone settings. You are *req ...
- PHP date()函数警告: It is not safe to rely on the system解决方法
访问网站提示: date(): It is not safe to rely on the system's timezone settings. You are *required* to use ...
- php echo输出多了 date(): It is not safe to rely on the system‘s timezone settings
原因 如果使用PHP5.3以上版本时,如果没有正确的配置php.ini就会出现PHP日期函数的错误.以前很多旧的PHP编程教程没有说到这个问题,所以不少读者会觉得困惑,下面笔者为大家讲述解决这个问题的 ...
- 解决PHP date调用警告 It is not safe to rely on the system's timezo
转载: It is not safe to rely on the system's timezone settings 在写php程序中有时会出现这样的警告:PHP Warning: date(): ...
最新文章
- 只要做出角色3D模型,AI就能让它动起来!再也不怕3D动画拖更了丨SIGGRAPH 2020
- Ignite的jdbc与网格的连接方式的查询性能对比
- python比较字符串相似度
- css transform Y旋转 dom隐藏
- Mac电脑mysql创建数据库步骤_mac上创建MySQL的基本步骤
- centos7上使用chrony自动同步时间
- Ajax与jQuery、json
- shield tv android tv,NVIDIA老机顶盒SHIELD TV升级安卓7.0:国行眼巴巴
- python机器学习生物信息学-疾病预测模型
- AI加持的mPaaS如何打造“最懂用户”的App
- Excel如何删除表格中的空白列
- WORD之文字处理之插入复合条饼图
- Debian 7 源(32/64bit)好用的源
- 企业宣传型小程序特点-微信小程序开发-视频教程23
- 〈三〉ElasticSearch的认识:搜索、过滤、排序
- 夜神模拟器换完本机的ip连不上忘 fiddler也抓不到模拟器的包
- Guava-Utilites学习测试类
- 前端导出多页pdf 带目录 页眉 页脚及页码
- 20189200余超 2018-2019-2 移动平台应用开发实践第四作业
- 2021襄阳五中学高考成绩查询,高考快讯|襄阳五中2021名考生参加2021年高考
热门文章
- 长尾理论作者称互联网商业模式亟待创新
- 95后公务员月薪5千辞职被拒:“工作就像婚姻,不爱了,也还是能凑合的”
- 瑰丽华尔兹--单调队列
- 冰河时代英文台词_即将到来的冰河时代
- 纵有疾风起,人生不言弃
- SIMCOM800C GSM模组(2G通信模组)AT指令测试 TCP 通信过程
- Flink1.14提交任务报错classloader.check-leaked-classloader问题解决
- 显示屏在线测试软件,Monitor Test Screens显示器测试
- 沃尔沃再次冲击IPO,能解与吉利的“十年之痒”吗?
- Python副业兼职,月赚7800元,一天只要两小时 !