[請益] 想請問關於data()警告訊息的意思

看板PHP作者 (我 有我的倔強...)時間18年前 (2007/10/24 16:50), 編輯推噓2(204)
留言6則, 3人參與, 最新討論串1/1
有一個警告訊息困惑很久了,之前忙著把其它功能寫完所以沒有去理它... 雖然有取得想要的結果,但是每次執行都會出現下面的警告訊息,覺得很礙眼= =: PHP Strict Standards: date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 X:\php\abc.php on line 89 89行,我只是想利用日期搭配$Code內的字串產生一組id,程式碼如下: $ID=$Code."-".date(Ymd); 想請教各位前輩,這段訊息是叫我做什麼呢?? 謝謝^^ -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.64.235

10/24 16:55, , 1F
#4376
10/24 16:55, 1F

10/24 16:56, , 2F
而且訊息裡明明就有寫啊
10/24 16:56, 2F

10/24 17:10, , 3F
少了引號嗎= =a 猜的
10/24 17:10, 3F

10/24 17:33, , 4F
唔 但是我都有如預期取到了日期->yyyymmdd 所以不明白警告
10/24 17:33, 4F

10/24 17:47, , 5F
喔喔 改了時區果然有用...感謝^^
10/24 17:47, 5F

10/24 18:31, , 6F
因為你error reporting設到E_STRICT所以他特別嚴格啊
10/24 18:31, 6F
文章代碼(AID): #177mThQ0 (PHP)
文章代碼(AID): #177mThQ0 (PHP)