I have a string 31/05/2017
And I want to convert it to MYSQL format, 2017-05-31 00:00:00
.
What I have done is.
$dateString = '31/05/2017';
$timestamp = strtotime($dateString);
$date = date("Y-m-d H:i:s", $timestamp);
But strtotime
is returning false
.