Convert/Format date/time in DB to AM/PM time

I got a database where I have a start time and end time, I want to display them in AM/PM time, they are in military time and with a date, I think substr would help me get just the time, but how would I convert “2010-03-06 19:00:00” to “03/06/2010 7:00 AM”? Thanks

Without seeing the code and how you are getting these dates, check out the date function on the php.net website.

http://php.net/manual/en/function.date.php

Hope this helps you.

Use this

$today = date(“F j, Y, g:i a”); to conver the format

Hope this is what you want

Sponsor our Newsletter | Privacy Policy | Terms of Service