JustinK101 Posted July 16, 2009 Share Posted July 16, 2009 How do I convert: $time = "8:15 pm"; to: $formatted_time = "20:15" Also another example: $time = "5:25 am"; $formatted_time = "05:25" Thanks. Link to comment https://forums.phpfreaks.com/topic/166159-how-to-convert-time-from-815-pm-to-2015/ Share on other sites More sharing options...
JustinK101 Posted July 16, 2009 Author Share Posted July 16, 2009 Think I got it: $formatted_time = date("H:i:s", strtotime($time)); Link to comment https://forums.phpfreaks.com/topic/166159-how-to-convert-time-from-815-pm-to-2015/#findComment-876256 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.