def METHOD_NAME(self):
    """Get the first and last date from the bufr file."""
    fh = open(self.filename, "rb")
    i = 0
    while True:
        # get handle for message
        bufr = ec.codes_bufr_new_from_file(fh)
        if bufr is None:
            break
        ec.codes_set(bufr, 'unpack', 1)
        year = ec.codes_get(bufr, 'year')
        month = ec.codes_get(bufr, 'month')
        day = ec.codes_get(bufr, 'day')
        hour = ec.codes_get(bufr, 'hour')
        minute = ec.codes_get(bufr, 'minute')
        second = ec.codes_get(bufr, 'second')
        obs_time = datetime(year=year, month=month, day=day, hour=hour, minute=minute, second=second)
        if i == 0:
            start_time = obs_time
        ec.codes_release(bufr)
        i += 1
    end_time = obs_time
    fh.close()
    return start_time, end_time