from datetime import datetime


def translate_date(str, in_format, out_format):
    """Convert a date to ISO8601 date format without time"""
    try:
        return datetime.strptime(str.strip(), in_format).date().strftime(out_format)
    except Exception:
        pass
    return ''