def _strftime_through_series(values, date_format: str):
    """Coerce an array of datetime-like values to a pandas Series and
    apply string formatting
    """
    values_as_series = pd.Series(duck_array_ops.ravel(values), copy=False)
    strs = values_as_series.dt.strftime(date_format)
    return strs.values.reshape(values.shape)
Coerce an array of datetime-like values to a pandas Series and
    apply string formatting
    
xarray/core/accessor_dt.py