import time


def parse_date(filename):
    """
        From a string passed that in the format of the file name convert it
        and return in time.struct_time.

        :params:
            :param filename: string that represents a filename, date is in the
                             in filname.

        :return: time, a 9-valued tuple: ( year, month, day, hour, minute,
                                           second, day of week, day of year,
                                           dst-flag )
        :rtype: time.struct_time, tuple
    """
    date_str = filename[2:-13]
    year, jday, hour = date_str.split('_')
    year, jday, hr, mins = int(year), int(jday), int(hour[:2]), int(hour[2:])

    AUTO_DETECT_DAYLIGHT = -1
    return time.struct_time(
        (year, 0, 0, hr, mins, 0, 0, jday, AUTO_DETECT_DAYLIGHT)
    )