Try inserting this after that line: $hour = ($hour > 12 ? $hour % 12 : $hour);
Hope that helps.
(By the way, 24-hour time is just as valid as 12-hour time, and simpler, lacking the added complication of having to specify AM/PM. ;)
In reply to Re: Converting 24 hour time back into 12 hour
by atcroft
in thread Converting 24 hour time back into 12 hour
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |