def convert_date(d: Dict[str, Any], key: str) -> None:
    """
    Modifies ``d[key]``, if it exists, to convert it to a
    :class:`datetime.datetime` or ``None``.

    Args:
        d: dictionary
        key: key
    """
    if key not in d:
        return
    value = d[key]
    if value:
        d[key] = datetime.datetime.strptime(value,
                                            YEAR_MONTH_FMT)
    else:
        d[key] = None