【发布时间】:2019-05-19 16:37:36
【问题描述】:
当我编辑数据并提交该表单后,我收到了类似的错误
错误 - 2019-05-19 12:40:26 --> 严重性:错误 --> 异常:在布尔值上调用成员函数 format() 请帮我解决这个问题....
我关注了这个,但它不起作用Call to a member function format() on boolean in PHP LARAVEL
$datetime = DateTime::createFromFormat('d/m/Y H:i:s', $date . ' ' . $time);
$created_at = $datetime->format('Y-m-d H:i:s');
$record = ['created_at' => $created_at,];
【问题讨论】:
-
什么是
$date和$time?可能与您的格式不符。 -
不如试试
strtotime()
标签: php