woolyg Posted July 21, 2007 Share Posted July 21, 2007 Hi, If I have a datetime field that saves info in the format 2007-07-21 16:59:36, and use <?php $result = mysql_query ("SELECT table.date_added FROM table"); while ($row = mysql_fetch_array($result)) { $date = $row['date_added']; echo $date; } How can I format the info that's been outputted from the query to 'Saturday 21st July 2007 16:59:36' ? It's eluding me! Any help appreciated, Woolyg. Link to comment https://forums.phpfreaks.com/topic/61156-solved-datetime-formatting/ Share on other sites More sharing options...
Barand Posted July 21, 2007 Share Posted July 21, 2007 $date = $row['date_added']; echo date('l jS F Y H:i:s', strtotime($date)); Link to comment https://forums.phpfreaks.com/topic/61156-solved-datetime-formatting/#findComment-304356 Share on other sites More sharing options...
woolyg Posted July 22, 2007 Author Share Posted July 22, 2007 Thank a million Barand. Perfect, I'll note this one down - Woolyg. Link to comment https://forums.phpfreaks.com/topic/61156-solved-datetime-formatting/#findComment-304505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.