久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php如何去掉獲取當(dāng)前日期時的警告

      php去掉獲取當(dāng)前日期時的警告的方法:1、在php.ini中設(shè)置date.timezone的值為PRC;2、取消date.timezone=PRC代碼前的注釋;3、重啟apache。

      php如何去掉獲取當(dāng)前日期時的警告

      本文操作環(huán)境:windows10系統(tǒng)、php 7、thinkpad t480電腦。

      在獲取當(dāng)前日期時可能會產(chǎn)生如下類似的警告:

      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 ewsfile.php on line 17 。

      這是因為PHP所取的時間是格林威治標(biāo)準(zhǔn)時間,所以和你當(dāng)?shù)氐臅r間會有出入。格林威治標(biāo)準(zhǔn)時間和北京時間大概差8個小時左右,我們可以按照下面的方法解決:

      1、在頁頭使用date_default_timezone_set()設(shè)置我的默認(rèn)時區(qū)為北京時間。

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

      然后重啟apache即可。

      推薦學(xué)習(xí):php培訓(xùn)

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號