cht電腦資訊網路
adm Find login register

apache/php strtotime()

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
1subject: apache/php strtotime()Promote 0 Bookmark 02011-10-23quote  

今天才注意到 /var/log/httpd/error_log 長到 7G 那麼大,嚇死人。

裏面都是

PHP Warning:  strtotime() [<a href='function.strtotime'>function.strtotime</a>]: 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 'Asia/Chongqing' for 'CST/8.0/no DST' instead in

只要設定 

/etc/php.ini

date.timezone = Asia/Taipei

這個 warning 就不見了。

其實我根本就沒有用 time zone,只是把 UTC(GMT) 的時間轉成 Unix 的 time_t 而已。

反正 php 看到沒有設定 date.timezone 就給 warning。 

edited: 2

cht電腦資訊網路
adm Find login register
views:2957