chrono::round

Function duration_trunc

Source
fn duration_trunc<T>(
    naive: NaiveDateTime,
    original: T,
    duration: TimeDelta,
) -> Result<T, RoundingError>
where T: Timelike + Add<TimeDelta, Output = T> + Sub<TimeDelta, Output = T>,