From 9311cca22197b48a00346c76d410c7a85de59758 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Wed, 12 Jun 2024 12:04:19 +0200 Subject: [PATCH] Remove deprecated chrono functions. (#1199) This PR replaces a now deprecated use of chrono with its current equivalent. --- src/commons/api/history.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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() } }