def reformatDate(datestring, dateformat):
    try:
        newDate = dateutil.parser.parse(datestring, dayfirst=True)
        return newDate.strftime(dateformat)
    except ValueError as e:
        raise ValueError('Make sure that all datetime columns are well-formatted and that they contain dates that are within the possible bounds.') from e
def reformatDate(datestring, dateformat):
    try:
        newDate = dateutil.parser.parse(datestring, dayfirst=True)
        return newDate.strftime(dateformat)
    except ValueError as e:
        raise ValueError('Make sure that all datetime columns are well-formatted and that they contain dates that are within the possible bounds.') from e