<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _get_expiration_date(cert):
    '''
    Returns a datetime.datetime object
    '''
    cert_obj = _read_cert(cert)

    if cert_obj is None:
        raise CommandExecutionError(
            'Failed to read cert from {0}, see log for details'.format(cert)
        )

    return datetime.strptime(
        salt.utils.stringutils.to_str(cert_obj.get_notAfter()),
        four_digit_year_fmt
    )