最近查看Apache Log 發現常常會出現:
1 2 3 4 5 |
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..... |
原來在PHP 5.1.0開始在呼叫date此函式時,timezone設定不正確就會有以上警告,此時只需修改php.ini找到date.timezone改為
1 |
date.timezone = Asia/Taipei //依據所在時區設定 |