StefanRSA Posted July 20, 2009 Share Posted July 20, 2009 $addate=$adresult['addate']; outputs 2009-07-13 23:46:55 (Read from the DB) Is there an easy way to convert $addate to 13 July 2009? I am struggeling a bit with php.net and its explanation of the date strings Thanks Link to comment https://forums.phpfreaks.com/topic/166610-solved-convert-yyyymmdd-hhmmss-to-day-month-year/ Share on other sites More sharing options...
Q Posted July 20, 2009 Share Posted July 20, 2009 How bout using date("d m Y", $addate); ? Link to comment https://forums.phpfreaks.com/topic/166610-solved-convert-yyyymmdd-hhmmss-to-day-month-year/#findComment-878532 Share on other sites More sharing options...
StefanRSA Posted July 20, 2009 Author Share Posted July 20, 2009 It returns '01 01 1970' Link to comment https://forums.phpfreaks.com/topic/166610-solved-convert-yyyymmdd-hhmmss-to-day-month-year/#findComment-878535 Share on other sites More sharing options...
Daniel0 Posted July 20, 2009 Share Posted July 20, 2009 Use strtotime to make it a UNIX timestamp. Then do what Q said. Link to comment https://forums.phpfreaks.com/topic/166610-solved-convert-yyyymmdd-hhmmss-to-day-month-year/#findComment-878587 Share on other sites More sharing options...
StefanRSA Posted July 20, 2009 Author Share Posted July 20, 2009 Works Great! Thanks! Link to comment https://forums.phpfreaks.com/topic/166610-solved-convert-yyyymmdd-hhmmss-to-day-month-year/#findComment-878651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.