簡體   English   中英

轉換mysql時間戳時,strtotime()在新的PHP版本中中斷

[英]strtotime() breaking in new php version when converting mysql timestamp

我正在轉換我的mysql時間戳

$timeStampDate=date("F j, Y g:ia", strtotime($row["projectTimeStamp"]));

不幸的是,新的php版本不喜歡這樣,並且給了我一系列錯誤。

Strict Standards: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. 

我一直在玩.htaccess,添加php_value date.timezone Europe/London但這是一個問題。

我只需要mysql NOW()在$ variable中可讀。

我討厭軟件更新。 PHP Version 5.2.17

您必須使用date_default_timezone_set()設置默認時區

或在php.ini中: datetime.timezone

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM