modularized time conversion of 24-hour to 12-hour format