from datetime import datetime


def convert_time(dt):
    """Convert datetime from ISO 8601 format to seconds since midnight."""
    dt = datetime.strptime(dt[:19], '%Y-%m-%dT%H:%M:%S')
    return dt.hour * 60 * 60 + dt.minute * 60