Try this should help:
$datedb = "2018-03-01 11:54:33";
$date = date('d-m-Y', strtotime($datedb));
echo $date; // will print 01-03-2018
And read about date()
function of php
: http://php.net/manual/en/function.date.php; https://www.w3schools.com/php/func_date_date.asp
0
solved SQL Timestamp format in PHP [duplicate]