日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

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

發布時間:2023/11/27 59 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的全部內容,希望文章能夠幫你解決所遇到的問題。

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