diff --git a/orgize/src/elements/timestamp.rs b/orgize/src/elements/timestamp.rs index 9115dba..dfe3a31 100644 --- a/orgize/src/elements/timestamp.rs +++ b/orgize/src/elements/timestamp.rs @@ -66,6 +66,12 @@ mod chrono { } } + impl Into> for Datetime<'_> { + fn into(self) -> DateTime { + (&self).into() + } + } + impl Into for &Datetime<'_> { fn into(self) -> NaiveDate { NaiveDate::from_ymd(self.year.into(), self.month.into(), self.day.into()) @@ -87,6 +93,12 @@ mod chrono { NaiveDateTime::new(self.into(), self.into()) } } + + impl Into> for &Datetime<'_> { + fn into(self) -> DateTime { + DateTime::from_utc(self.into(), Utc) + } + } } #[cfg_attr(test, derive(PartialEq))]