Skip to content

Commit

Permalink
build: Update chrono to 0.4.38 (#3990)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-auer authored Sep 5, 2024
1 parent 9c5f180 commit ba17924
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions relay-common/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::fmt;
use std::time::{Duration, Instant, SystemTime};

use chrono::{DateTime, NaiveDateTime, TimeZone, Utc};
use chrono::{DateTime, TimeZone, Utc};
use serde::{Deserialize, Serialize};

/// Converts an `Instant` into a `SystemTime`.
Expand Down Expand Up @@ -116,8 +116,7 @@ impl UnixTimestamp {

/// Returns the timestamp as chrono datetime.
pub fn as_datetime(self) -> Option<DateTime<Utc>> {
NaiveDateTime::from_timestamp_opt(self.0 as i64, 0)
.map(|n| DateTime::from_naive_utc_and_offset(n, Utc))
DateTime::from_timestamp(self.0 as i64, 0)
}
}

Expand Down

0 comments on commit ba17924

Please sign in to comment.