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 Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/123792-converting-time-format/#findComment-639177 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.