Solarpitch Posted August 11, 2008 Share Posted August 11, 2008 Hi, I'm trying to convert this format "13:20" to this "01:30 pm" using this.. <?php $time = strtotime(date('g:i a') . $time); echo $time; ?> .. but all it seems to print out is 1218453480 Quote Link to comment https://forums.phpfreaks.com/topic/119128-strtotime-question/ Share on other sites More sharing options...
JasonLewis Posted August 11, 2008 Share Posted August 11, 2008 Nothing strange about that. strtotime() = String to Time = String to Unix Timestamp. Try re-arranging a few things. Quote Link to comment https://forums.phpfreaks.com/topic/119128-strtotime-question/#findComment-613396 Share on other sites More sharing options...
wildteen88 Posted August 11, 2008 Share Posted August 11, 2008 It needs to be $time = date('g:i a', strtotime($time)); Quote Link to comment https://forums.phpfreaks.com/topic/119128-strtotime-question/#findComment-613397 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.