from datetime import datetime


def xarraytime_to_datetime(xarraytime):
    """Convert an `xarray.DataArray` of `numpy.datetime64` times to a
    `numpy.ndarray` of `datetime.datetime` times

    :arg xarraytime: DataArray of datetime64
    :type xarraytime: :py:class:`xarray.DataArray` of :py:class:`numpy.datetime64`

    :returns: array of datetimes
    :rtype: :py:class:`numpy.ndarray` of :py:class:`datetime.datetime`
    """

    datetime_obj = xarraytime.values.astype('datetime64[s]').astype(datetime)

    return datetime_obj