Get TimestampWithTimeZone from OffsetDateTime
Doing this currently means splitting an OffsetDateTime into Date, Time
and UtcOffset, which is a little silly when it just gets converted back
into an OffsetDateTime.
@@ -24,6 +24,12 @@ impl From<pg_sys::TimestampTz> for TimestampWithTimeZone {
}
}
+impl From<time::OffsetDateTime> for TimestampWithTimeZone {
+ fn from(time: time::OffsetDateTime) -> Self {
+ TimestampWithTimeZone(time)
+ }
+}
+
impl FromDatum for TimestampWithTimeZone {
#[inline]
