I'm trying to convert the DATETIME to something that people can actually use. This is the date:
2013-09-05 11:52:10
I'm using:
date("D, d M Y", '2013-09-05 11:52:10');
Is turning into:
Thu, 01 Jan 1970
Makes no sense to me.
You need to turn the date into a timestamp before passing it to date()
$time = strtotime('2013-09-05 11:52:10');
echo date("D, d M Y", $time);
Is this supposed to be PHP code? If so, the correct is
date("D, d M Y", strtotime('2013-09-05 11:52:10'));
If this has to do with MySql, the correct function to use is DATE_FORMAT
(however, what you have is invalid MySql syntax). Please clarify.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With