RJP1 Posted July 12, 2010 Share Posted July 12, 2010 Hey guys, for the life of me, I can't find the right php technique for converting a date/time number format into something useful... e.g 2010-09-16 12:09:19 to 16th September 2010 If you could point me in the correct direction, that would be great! Cheers, RJP1 Link to comment https://forums.phpfreaks.com/topic/207540-how-to-parse-2010-09-16-120919-style-date/ Share on other sites More sharing options...
AbraCadaver Posted July 12, 2010 Share Posted July 12, 2010 date('j F Y', strtotime('2010-09-16 12:09:19')); Link to comment https://forums.phpfreaks.com/topic/207540-how-to-parse-2010-09-16-120919-style-date/#findComment-1085074 Share on other sites More sharing options...
RJP1 Posted July 12, 2010 Author Share Posted July 12, 2010 Ah thanks AbraCadaver, I tried something very similar but it kept giving the year as 1969! Cheers for the speedy help, really appreciated! RJP1 Link to comment https://forums.phpfreaks.com/topic/207540-how-to-parse-2010-09-16-120919-style-date/#findComment-1085076 Share on other sites More sharing options...
Pikachu2000 Posted July 12, 2010 Share Posted July 12, 2010 If it's coming from a MySQL database query, you can format it in the query itself, too. SELECT DATE_FORMAT(date_field, '%D %M, %Y) Link to comment https://forums.phpfreaks.com/topic/207540-how-to-parse-2010-09-16-120919-style-date/#findComment-1085109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.