Method lrs::time::Zone::compact

Returns a normalized version of a DateTime and a time that expands to the normalized date.

Syntax

impl Zone {
    fn compact(&self, date: DateTime) -> (DateTime, Time)
}

Arguments

NameDescription
date

The date to compact.

Remarks

This function looks at the following fields: year, month, day, hour, minute, second. All other fields will be calculated from these fields. Note that, if the date cannot be represented as a time in the given timezone (e.g. because the year is too large or the time falls into the one hour hole between winter and summer time) then the return value will not agree with the given date in the fields mentioned above but the property that the returned time expands to the returned DateTime still holds.

The fields mentioned above are normalized according to the following algorithm: