def _validate_date_like_dtype(dtype):
try:<EOL><INDENT>typ = np.datetime_data(dtype)[<NUM_LIT:0>]<EOL><DEDENT>except ValueError as e:<EOL><INDENT>raise TypeError('<STR_LIT>'.format(error=e))<EOL><DEDENT>if typ != '<STR_LIT>' and typ != '<STR_LIT>':<EOL><INDENT>msg = '<STR_LIT>'<EOL>raise ValueError(msg.format(name=dtype.name, type=dtype.type.__name__))<EOL><DEDENT>
Check whether the dtype is a date-like dtype. Raises an error if invalid.

Parameters
----------
dtype : dtype, type
    The dtype to check.

Raises
------
TypeError : The dtype could not be casted to a date-like dtype.
ValueError : The dtype is an illegal date-like dtype (e.g. the
             the frequency provided is too specific)