[go: up one dir, main page]

Module round

Module round 

Source
Available on crate feature chrono only.
Expand description

Functionality for rounding or truncating a DateTime by a Duration.

Enums§

RoundingError
An error from rounding by Duration

Traits§

DurationRound
Extension trait for rounding or truncating a DateTime by a Duration.
SubsecRound
Extension trait for subsecond rounding or truncation to a maximum number of digits. Rounding can be used to decrease the error variance when serializing/persisting to lower precision. Truncation is the default behavior in Chrono display formatting. Either can be used to guarantee equality (e.g. for testing) when round-tripping through a lower precision format.