def parse_domain_date(domain_date: Union[(List[str], str)], date_format: str='%Y-%m-%dT%H:%M:%S.000Z') -> Optional[str]:
    "Converts whois date format to an ISO8601 string\n\n    Converts the HelloWorld domain WHOIS date (YYYY-mm-dd HH:MM:SS) format\n    in a datetime. If a list is returned with multiple elements, takes only\n    the first one.\n\n    :type domain_date: ``Union[List[str],str]``\n    :param date_format:\n        a string or list of strings with the format 'YYYY-mm-DD HH:MM:SS'\n\n    :return: Parsed time in ISO8601 format\n    :rtype: ``Optional[str]``\n    "
    if isinstance(domain_date, str):
        domain_date_dt = dateparser.parse(domain_date)
        if domain_date_dt:
            return domain_date_dt.strftime(date_format)
    elif (isinstance(domain_date, list) and (len(domain_date) > 0) and isinstance(domain_date[0], str)):
        domain_date_dt = dateparser.parse(domain_date[0])
        if domain_date_dt:
            return domain_date_dt.strftime(date_format)
    return None
Converts whois date format to an ISO8601 string

Converts the HelloWorld domain WHOIS date (YYYY-mm-dd HH:MM:SS) format
in a datetime. If a list is returned with multiple elements, takes only
the first one.

:type domain_date: ``Union[List[str],str]``
:param date_format:
    a string or list of strings with the format 'YYYY-mm-DD HH:MM:SS'

:return: Parsed time in ISO8601 format
:rtype: ``Optional[str]``
def parse_domain_date(domain_date: Union[(List[str], str)], date_format: str='%Y-%m-%dT%H:%M:%S.000Z') -> Optional[str]:
    "Converts whois date format to an ISO8601 string\n\n    Converts the HelloWorld domain WHOIS date (YYYY-mm-dd HH:MM:SS) format\n    in a datetime. If a list is returned with multiple elements, takes only\n    the first one.\n\n    :type domain_date: ``Union[List[str],str]``\n    :param date_format:\n        a string or list of strings with the format 'YYYY-mm-DD HH:MM:SS'\n\n    :return: Parsed time in ISO8601 format\n    :rtype: ``Optional[str]``\n    "
    if isinstance(domain_date, str):
        domain_date_dt = dateparser.parse(domain_date)
        if domain_date_dt:
            return domain_date_dt.strftime(date_format)
    elif (isinstance(domain_date, list) and (len(domain_date) > 0) and isinstance(domain_date[0], str)):
        domain_date_dt = dateparser.parse(domain_date[0])
        if domain_date_dt:
            return domain_date_dt.strftime(date_format)
    return None