cgm225 Posted September 11, 2008 Share Posted September 11, 2008 If I have a variable, lets say $time, and it contains a timestamp in the following format for example, 2008-09-09 22:31:14, how can I convert it to the following time format, August 8th, 2007 1:15 am ? Thanks in advance! bt Link to comment https://forums.phpfreaks.com/topic/123792-converting-time-format/ Share on other sites More sharing options...
kenrbnsn Posted September 11, 2008 Share Posted September 11, 2008 Use a combination of date() and strtotime() <?php echo date('F jS, T G:i a',strtotime('2008-09-09 22:31:14')); ?> Ken Link to comment https://forums.phpfreaks.com/topic/123792-converting-time-format/#findComment-639176 Share on other sites More sharing options...
Maq Posted September 11, 2008 Share Posted September 11, 2008 http://us3.php.net/date $today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm Link to comment https://forums.phpfreaks.com/topic/123792-converting-time-format/#findComment-639177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.