Check if a dtype is a subclass of the numpy datetime types

def is_np_datetime_like(dtype: Union[str, np.dtype]) -> bool:
    """Check if a dtype is a subclass of the numpy datetime types
    """
    return (np.issubdtype(dtype, np.datetime64) or
            np.issubdtype(dtype, np.timedelta64))