import time


def format_ampm(time_24hour) -> str:
    """Convert 24 hour to 12 hour system"""
    t = time.strptime(time_24hour, "%H%M")  # Create time object
    timevalue_12hour = time.strftime("%-I:%M %p", t)  # e.g. From 08:14 to 8:14 AM or 15:24 to 3:24 PM
    return timevalue_12hour