/// A structured field value [date]. /// /// Dates represent an integer number of seconds from the Unix epoch. /// /// [`Version::Rfc9651`][`crate::Version::Rfc9651`] supports bare items of this /// type; [`Version::Rfc8941`][`crate::Version::Rfc8941`] does not. /// /// [date]: <https://httpwg.org/specs/rfc9651.html#date> #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pubstruct Date(Integer);
impl Date { /// The minimum value for a parsed or serialized date, corresponding to /// [`Integer::MIN`] seconds from the Unix epoch. pubconst MIN: Self = Self::from_unix_seconds(Integer::MIN);
/// The maximum value for a parsed or serialized date, corresponding to /// [`Integer::MAX`] seconds from the Unix epoch. pubconst MAX: Self = Self::from_unix_seconds(Integer::MAX);
/// The Unix epoch: `1970-01-01T00:00:00Z`. pubconst UNIX_EPOCH: Self = Self::from_unix_seconds(Integer::ZERO);
/// Returns the date as an integer number of seconds from the Unix epoch. #[must_use] pubfn unix_seconds(&self) -> Integer { self.0
}
/// Creates a date from an integer number of seconds from the Unix epoch. #[must_use] pubconstfn from_unix_seconds(v: Integer) -> Self { Self(v)
}
}
impl fmt::Display for Date { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "@{}", self.unix_seconds())
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.