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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

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

發布時間:2023/11/27 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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. 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 D:\PHPWEB\news\file.php on line 17 。這是因為PHP所取的時間是格林威治標準時間,所以和你當地的時間會有出入格林威治標準時間和北京時間大概差8個小時左右,我們可以按照下面的方法解決:
1、在頁頭使用date_default_timezone_set()設置我的默認時區為北京時間,即 <?php date_default_timezone_set("PRC"); ?>就可以了。
2、在php.ini中設置date.timezone的值為PRC,設置好以后的為:date.timezone=PRC,同時取消這一行代碼的注釋,即去掉前面的分號就可以了。?

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。