Skip to content

Commit

Permalink
Remove deprecated chrono functions. (#1199)
Browse files Browse the repository at this point in the history
This PR replaces a now deprecated use of chrono with its current equivalent.
  • Loading branch information
partim authored Jun 12, 2024
1 parent bb90510 commit 9311cca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/commons/api/history.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::BTreeMap, fmt};

use chrono::{DateTime, NaiveDateTime, SecondsFormat, Utc};
use chrono::{DateTime, SecondsFormat};

use rpki::{
ca::{
Expand Down Expand Up @@ -123,8 +123,9 @@ impl<E: Event, I: InitEvent> From<StoredEffect<E, I>> 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()
}
}

Expand Down

0 comments on commit 9311cca

Please sign in to comment.