最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

關(guān)于php程序報date()警告的處理(date_default_timezone_set)

 更新時間:2013年10月22日 23:26:53   作者:  
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

在寫php程序中有時會出現(xià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 ews\file.php on line 17 。

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

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

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

然后重啟apache即可!

相關(guān)文章

最新評論

安阳市| 兖州市| 治县。| 肃南| 方山县| 湖州市| 姜堰市| 桃源县| 剑川县| 茌平县| 霸州市| 那曲县| 锦屏县| 育儿| 泾阳县| 新和县| 巩留县| 淮北市| 惠来县| 连云港市| 微博| 金湖县| 杭州市| 肇源县| 崇义县| 阳谷县| 西充县| 游戏| 巴里| 荔波县| 广丰县| 安吉县| 曲麻莱县| 和林格尔县| 文登市| 达拉特旗| 灵石县| 泽普县| 南汇区| 揭阳市| 石河子市|