diff --git a/convergence/src/to_wire.rs b/convergence/src/to_wire.rs index cafcce1..355e1ed 100644 --- a/convergence/src/to_wire.rs +++ b/convergence/src/to_wire.rs @@ -1,5 +1,5 @@ use bytes::BytesMut; -use chrono::{NaiveDate, NaiveDateTime, NaiveTime}; +use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, Utc}; use postgres_types::ToSql; use rust_decimal::Decimal; @@ -81,6 +81,15 @@ impl ToWire for NaiveTime { } } +impl ToWire for DateTime { + fn to_binary(&self) -> Vec { + self.naive_utc().to_binary() + } + fn to_text(&self) -> Vec { + self.to_rfc3339().as_bytes().into() + } +} + impl ToWire for Decimal { fn to_binary(&self) -> Vec { let mut b = BytesMut::new();