-3

Possible Duplicate:
Convert one date format into another in PHP

I am currently pulling from my SQL database the event dates i.e in the table field date it will display (2011-12-08) however i wish to have it output December 8th, 2011 rather than 2011-12-08 when display through php on my website. Any ideas on how to go about this?

Community
  • 1
  • 1
user1096713
  • 111
  • 5
  • 4
    Please see the manual for the [DATE_FORMAT()-function](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format) – Fluff Dec 13 '11 at 22:31
  • Or use the PHP manual [DateTime class](http://www.php.net/manual/en/class.datetime.php) – Nanne Dec 13 '11 at 22:32
  • Welcome to Stack Overflow! This question has been asked over 5,000 times already, hence the downvoting... Use the search here or on Google to find the answers – Pekka Dec 13 '11 at 22:34

1 Answers1

-2

As people have said, for questions like this please search around first before asking since many places on the web and many other questions in stackoverflow already cover this. That said, my advice is to store the date in the database as a datetype because it will allow mysql to do its operations easier then convert the the human readable form upon displaying it using the php date function which would use format "F jS, Y" for what you want. Good luck and welcome to stackoverflow.

hackartist
  • 5,172
  • 4
  • 33
  • 48