崩溃:
<?php
$date = "13-06-2015 23:45:52";
echo Datetime::createFromFormat('d-m-Y h:i:s', $date)->format('Y-m-d h:i:s');
?>
Run Code Online (Sandbox Code Playgroud)
PHP致命错误:在布尔值上调用成员函数format()
但其他日期效果很好:
<?php
$date = "10.06.2015 09:25:52";
echo Datetime::createFromFormat('d-m-Y h:i:s', $date)->format('Y-m-d h:i:s');
?>
Run Code Online (Sandbox Code Playgroud)
错误的格式?