我不明白如何将日期时间保存到数据库。我有字符串
(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)
不工作:(