Topic: American Time Format
Hey guys,
I was realizing when adding those little touches to my website that I wanted to show time without the ZERO in front of the hour. An example you may have on your site is 05:16 am, and it looks ugly, well, to me as an American who is use to 5:16 AM. So the mode is this:
//------------------------------------------
// Get templates
//------------------------------------------
function get_date($date, $format = "date")
{
global $SESSION;
$diff = $SESSION->conf['timezone']*60;
$date = $date - (date("Z") - $diff) + (date("I") ? 3600 : 0);
if ( $format == "date" ) {
$format = $SESSION->conf['timeformat'] ? "m/d/Y" : "d/m/Y";
}
elseif ( $format == "time" ) {
$format = $SESSION->conf['timeformat'] ? "h:i a" : "H:i";
}
elseif ( $format == "rss" ) {
$format = "r";
}
elseif ( $format == "full" ) {
$format = $SESSION->conf['timeformat'] ? "m/d/Y g:i A" : "";
}
return date($format, $date);
}
// End function
Change h to lowercase g, and lowercase a to A, uppercase.
Simple!