茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1729118 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_60D_00326.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2009/11/15 6:37:03
冷日某個Case使用了最新版得XAMPP!
她的PHP版本是:PHP Version 5.3.0。
然後Case中,所有與『Date』有關的函數(Function)全部出現Warning,大致上主要在說的是:
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.


冷日稍微掃了一下,目前看起來,strtotime()、date()、mktime() 等都會出這個問題!
目前猜測應該是所有的DateTime都會有這個Warning!

這裡提供一些解決方案:
1.在你會用到datetime函式前,先使用:
date_default_timezone_set('Asia/Taipei');

2.或是乾脆寫一個全域的參數(冷日很愛用這招):
date_default_timezone_set('UTC+8');

3.不然,就直接在php.ini裡加上(預設是被makr掉的空白):
date.timezone=Asia/Taipei


這樣大家就可以繼續高高興興的使用各式DateTime Function了!
推眼鏡
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|