daveh33 Posted January 2, 2008 Share Posted January 2, 2008 I have a column in my mysql with datetime stamp I have written this code $time = $row['lastlogin']; When I echo $time - it outputs in the following format: - YYYY-MM-DD HH:MM:SS How can I reformat this to Example: - 2nd January 2008 12:15 Link to comment https://forums.phpfreaks.com/topic/84100-solved-reformat-datetime-stamp/ Share on other sites More sharing options...
rajivgonsalves Posted January 2, 2008 Share Posted January 2, 2008 here you go use the date function with strtotime function <?php $strTime = "2008-01-02 12:15:30"; echo date("jS F Y H:i",strtotime($strTime)); ?> Link to comment https://forums.phpfreaks.com/topic/84100-solved-reformat-datetime-stamp/#findComment-428080 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.