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 Quote Link to comment 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)); ?> Quote Link to comment 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.