1
我無法理解如何將日期時間保存到數據庫。我有串Symfony2,學說,如何將日期時間設置爲實體
(string) $oXml->currentTime
實際上它不是一個字符串,但我們把它轉換,所以,我怎麼可以將其添加到實體沒有錯誤
Fatal error: Call to a member function format() on a non-object in...
當前代碼
$currentTime = \DateTime::createFromFormat('Y-m-d H:m:s', (string) $oXml->currentTime);
$cachedUntil = \DateTime::createFromFormat('Y-m-d H:m:s', (string) $oXml->cachedUntil);
$oApiKeyInfo
->setCurrentTime($currentTime)
->setCachedUntil($cachedUntil)
不工作:(
thnx解決方案處於「設置時區」 – user1954544