出現Warning: date(): It is not safe to rely on the system's timezone settings.

如何排除Warning: date()?? php5.4 PHP版本從5.2.17到PHP 5.3.21(服務器)


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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\ on line 31


1.PHP程式碼頂端加上(台灣地區使用)
date_default_timezone_set( "Asia/Taipei" );


2.把時區在配置線在你的php.ini文件。

[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = Asia/Taipei
 

回上一頁

相關文章:

喜歡這篇文章嗎?立即分享

Posted : / Views: 3640
Last updated :2017-07-04