From 4b76c33c56734016a25c5d8943baddaa3cf844a0 Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Thu, 5 Mar 2009 00:06:03 +0000 Subject: [PATCH] Bug where 12pm shows up as 12am fixed. Also made 00am show up as 12am --- functions/functions.calendar.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/functions.calendar.php b/functions/functions.calendar.php index 2393f932..414f6d47 100644 --- a/functions/functions.calendar.php +++ b/functions/functions.calendar.php @@ -109,7 +109,11 @@ function convert_time($time) $m = substr($time,3,2); $s = intval(substr($time,5,2)); - if ($h > 12) + if ($h == 12) + return "12:$m"."pm"; + else if ($h == 0) + return "12:$m"."am"; + else if ($h > 12) return $h - 12 . ":$m"."pm"; else return $h . ":$m"."am";