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 Quote 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); ? Quote 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' Quote 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. Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.