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 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. 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)); Link to comment https://forums.phpfreaks.com/topic/119128-strtotime-question/#findComment-613397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.