Crashes on:
<?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');
?>
PHP Fatal error: Call to a member function format() on boolean
But with other dates works well:
<?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');
?>
Wrong format?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…