<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def convert_date(d, custom_date_string=None, fallback=None):
 """ for whatever reason, sometimes WP XML has unintelligible datetime strings for pubDate. In this case default to custom_date_string or today Use fallback in case a secondary date string is available. Incidentally, somehow the string 'Mon, 30 Nov -0001 00:00:00 +0000' shows up. '2015-03-30' """

        if d == 'Mon, 30 Nov -0001 00:00:00 +0000' and fallback:
            d = fallback
        try:
            date = time.strftime("%Y-%m-%d", time.strptime(d, '%a, %d %b %Y %H:%M:%S %z'))
        except ValueError:
            date = time.strftime("%Y-%m-%d", time.strptime(d, '%Y-%m-%d %H:%M:%S'))
        except ValueError:
            date = custom_date_string or datetime.datetime.today().strftime("%Y-%m-%d")
        return date