March 18, 2012
Format and echo datetime string received from MySQL?
Question by pufAmuf
how would I format a datetime string received from MySQL? For example, when I do
echo $info['start_datetime']
I get 2012-03-18 21:00:00, but I would like to Turn it into Sunday, March 18, 2012. I looked at the php documentation where it showed the different formats, but not specifically when they’re retrieved from MySQL.
Thanks everyone!
Answer by Ing
echo date('l, F d, Y', strtotime($info['start_datetime']));