webguync Posted May 21, 2010 Share Posted May 21, 2010 Hi, I have a timestamp in MySQL pulling the data out like so... echo "<td>{$row["submit_timestamp"]}</td></tr>"; understand I can use strtotime to get a more readable date and time. Currently looks like 2010-05-17 11:32:45 would rather it say, May 17, 2010 11:32:45am and if it is pm be 9:30:45pm in that format. thanks in advance for any assistance. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted May 21, 2010 Share Posted May 21, 2010 Use a combination of the strtotime and date functions. Ken Quote Link to comment Share on other sites More sharing options...
webguync Posted May 21, 2010 Author Share Posted May 21, 2010 thanks. Where would the date() and strtotime() functions need to go in the code I provided? Need a little help with the syntax. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted May 22, 2010 Share Posted May 22, 2010 <?php echo "<td>" . date('F j, Y g:i:sa', strtotime($row["submit_timestamp"])) . "</td></tr>"; ?> Ken Quote Link to comment Share on other sites More sharing options...
webguync Posted May 23, 2010 Author Share Posted May 23, 2010 great thanks! 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.