xarray.DataArray.dt.round

DataArray.dt.round(freq)

Round timestamps to specified frequency resolution.

Parameters

freq (a freq string indicating the rounding resolution) – e.g. ‘D’ for daily resolution

Returns

rounded timestamps – Array-like of datetime fields accessed for each element in values

Return type

same type as values