from datetime import datetime


def extract_time(time):
    """
    Convert the string into datetime format.
    
    :param time: string of time need to be converted. Example: '2017-01-16T15:09:28Z'
    :return: the time in datetime format
    """
    result = datetime.strptime(time[11: 19], '%H:%M:%S')
    return result