This is my PHP/MySQL query, as mentioned at Displaying links in PHP/MySQL?:
http://pastebin.com/5Td9Bybn
I\'ll admit, I\'ve forgotten how to use the strtotime()
strtotime()
will give you a timestamp, you use the function date() to format the display of time and/or date.
06:00
6:00am
6am
Read about date() and its formatting on php.net.
Do it in MySQL, as @Marc B suggests.
Change this line
$result = mysql_query("SELECT * FROM presenters1;", $connection) or die("error querying database");
to
$result = mysql_query("SELECT *, TIME_FORMAT(airtime, '%h:%i') `airtime` FROM presenters1;", $connection) or die("error querying database");
Then, change this line:
php echo strotime ('H') $result_ar['airtime']; ?>
to