def _possibly_convert_objects(values):
    """Convert object arrays into datetime64 and timedelta64 according
    to the pandas convention.

    * datetime.datetime
    * datetime.timedelta
    * pd.Timestamp
    * pd.Timedelta
    """
    as_series = pd.Series(values.ravel(), copy=False)
    result = np.asarray(as_series).reshape(values.shape)
    if not result.flags.writeable:
        # GH8843, pandas copy-on-write mode creates read-only arrays by default
        try:
            result.flags.writeable = True
        except ValueError:
            result = result.copy()
    return result
Convert object arrays into datetime64 and timedelta64 according
    to the pandas convention.

    * datetime.datetime
    * datetime.timedelta
    * pd.Timestamp
    * pd.Timedelta
    
xarray/core/variable.py