日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > php >内容正文

php

PHP问题 —— It is not safe to rely on the system's

發(fā)布時(shí)間:2025/3/20 php 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 PHP问题 —— It is not safe to rely on the system's 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.1? It is not safe to rely on the system's timezone settings

1.1.1? 現(xiàn)象

運(yùn)行PHP應(yīng)用,出現(xiàn)如下錯(cuò)誤信息:

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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.

1.1.2? 原因

這是因?yàn)镻HP所取的時(shí)間是格林威治標(biāo)準(zhǔn)時(shí)間,所以和你當(dāng)?shù)氐臅r(shí)間會(huì)有出入格林威治標(biāo)準(zhǔn)時(shí)間和北京時(shí)間大概差8個(gè)小時(shí)左右。

1.1.3? 解決

我們可以按照下面的方法解決:

1、 在頁頭使用date_default_timezone_set()設(shè)置我的默認(rèn)時(shí)區(qū)為北京時(shí)間,即<?phpdate_default_timezone_set("PRC");?>就可以了。

2、 在php.ini中設(shè)置date.timezone的值為PRC,設(shè)置好以后的為:date.timezone=PRC,同時(shí)取消這一行代碼的注釋,即去掉前面的分號(hào)就可以了。






本文轉(zhuǎn)自 tywali 51CTO博客,原文鏈接:http://blog.51cto.com/lancelot/1772959,如需轉(zhuǎn)載請(qǐng)自行聯(lián)系原作者

總結(jié)

以上是生活随笔為你收集整理的PHP问题 —— It is not safe to rely on the system's的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。