I'm creating a news script in PHP/MySQL.
When a new news post is enetered into the DB, the date is stored like this
$date= date('Y-m-d H:i:s');
so the query inserts taht date and the other info into the DB. my DB colum in MySQL is a datetime column
So the data looks like this when stored: 2002-10-17 19:58:05
Now, in my main script that displays the news, I have a which loop that selects all this data from the DB and then displays it. I want to convert the date from the current form it's in, to a form like this: October 17th, 2002, 22:03:45
I tried using this code:
$date= date("F j, Y, G:i a", $date);
but i got wierd output like: December 31, 1969, 19:33 pm
which is not the correct date hehe. Any help here?