diff --git a/src/commons/api/history.rs b/src/commons/api/history.rs index 8289285e2..84cc16745 100644 --- a/src/commons/api/history.rs +++ b/src/commons/api/history.rs @@ -1,6 +1,6 @@ use std::{collections::BTreeMap, fmt}; -use chrono::{DateTime, NaiveDateTime, SecondsFormat, Utc}; +use chrono::{DateTime, SecondsFormat}; use rpki::{ ca::{ @@ -123,8 +123,9 @@ impl From> for CommandHistoryResult { impl CommandHistoryRecord { pub fn time(&self) -> Time { let seconds = self.timestamp / 1000; - let time = NaiveDateTime::from_timestamp_opt(seconds, 0).expect("timestamp out-of-range"); - Time::from(DateTime::from_utc(time, Utc)) + DateTime::from_timestamp( + seconds, 0 + ).expect("timestamp out-of-range").into() } }