from datetime import datetime


def line_to_time(line):
    """ Extract timestamp from a line, created by log. """
    time = line.split('    ')[0].split(',')[0]
    time = datetime.strptime(time, '%Y-%m-%d %H:%M:%S')
    return time