Return $hour in 12-hour format (h) or 24-hour format (H) as appropriate.