I think this is asked before but i didn´t find it so here is the question:
How do i convert this:
2014-03-06 01:02:22
to this:
March 06, 2014 at 1:02 am
Need this in php.
Thanks!
I think this is asked before but i didn´t find it so here is the question:
How do i convert this:
2014-03-06 01:02:22
to this:
March 06, 2014 at 1:02 am
Need this in php.
Thanks!
It's quite easy if you have a valid date.
The procedural version of this is:
$date = '2014-03-06 01:02:22';
$unixTimestamp = strtotime($date);
echo date('jS m y', $unixTimestamp);
You can use any format you want instead of jS m y
, check the full list here: http://php.net/manual/ro/function.date.php