vinpkl Posted June 5, 2015 Share Posted June 5, 2015 Hi i have below format date and time stored in database 2015-06-06 02:13:54 How can i reformat it, so it displays as 06-06-2015 02:13:54 Thanks Vineet Link to comment https://forums.phpfreaks.com/topic/296662-reformat-date-while-displaying/ Share on other sites More sharing options...
Barand Posted June 5, 2015 Share Posted June 5, 2015 Either use php echo date('d-m-Y H:i:s', strtotime(db_date)); or use the SQL SELECT DATE_FORMAT(db_date, '%d-%m-%Y %H-%i-%s') ... Link to comment https://forums.phpfreaks.com/topic/296662-reformat-date-while-displaying/#findComment-1513266 Share on other sites More sharing options...
vinpkl Posted June 5, 2015 Author Share Posted June 5, 2015 Hi Barand This worked perfect. Thanks Vineet Link to comment https://forums.phpfreaks.com/topic/296662-reformat-date-while-displaying/#findComment-1513267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.