def parse_time(timestring):
    """ Given a string of the format YYYY-MM-DDTHH:MM:SS.SS-HH:MM (and
        optionally a DST flag), convert to and return a numeric value for
        elapsed seconds since midnight (date, UTC offset and/or decimal
        fractions of second are ignored).
    """
    date_time = timestring.split('T') # Separate into date and time
    hour_minute_second = date_time[1].split('+')[0].split('-')[0].split(':')
    return (int(hour_minute_second[0]) * 3600 +
            int(hour_minute_second[1]) * 60 +
            int(hour_minute_second[2].split('.')[0]))