Answer the question
In order to leave comments, you need to log in
How to format date and time from mysql to php?
It is necessary to turn the received date and time "2015-12-12 12:12:12" into "12/12/2015 at 12:12". Tried like this date('d.m.Y H:i', $x[0]['time'])
, but there are completely different date, time, and even an incomprehensible indent from above.
Answer the question
In order to leave comments, you need to log in
And who's stopping you from getting the date immediately in the right format via DATE_FORMAT() ?
so or
$date = date_create($x[0]['time']);
echo date_format($date, 'd.m.Y H:i');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question