def is_datetimelike(arr):
return (is_datetime64_dtype(arr) or is_datetime64tz_dtype(arr) or<EOL>is_timedelta64_dtype(arr) or<EOL>isinstance(arr, ABCPeriodIndex))<EOL>
Check whether an array-like is a datetime-like array-like.

Acceptable datetime-like objects are (but not limited to) datetime
indices, periodic indices, and timedelta indices.

Parameters
----------
arr : array-like
    The array-like to check.

Returns
-------
boolean
    Whether or not the array-like is a datetime-like array-like.

Examples
--------
>>> is_datetimelike([1, 2, 3])
False
>>> is_datetimelike(pd.Index([1, 2, 3]))
False
>>> is_datetimelike(pd.DatetimeIndex([1, 2, 3]))
True
>>> is_datetimelike(pd.DatetimeIndex([1, 2, 3], tz="US/Eastern"))
True
>>> is_datetimelike(pd.PeriodIndex([], freq="A"))
True
>>> is_datetimelike(np.array([], dtype=np.datetime64))
True
>>> is_datetimelike(pd.Series([], dtype="timedelta64[ns]"))
True
>>>
>>> dtype = DatetimeTZDtype("ns", tz="US/Eastern")
>>> s = pd.Series([], dtype=dtype)
>>> is_datetimelike(s)
True