Skip to content

Commit

Permalink
fix: use remove deprecated from_utc
Browse files Browse the repository at this point in the history
  • Loading branch information
thevaibhav-dixit committed Aug 29, 2023
1 parent 7974c0a commit 2376532
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl TryFrom<&TimeStampMilliStr> for TimeStamp {
fn try_from(value: &TimeStampMilliStr) -> Result<Self, Self::Error> {
let millis = value.0.parse::<i64>()?;
if let Some(naive) = NaiveDateTime::from_timestamp_opt(millis / 1000, 0) {
let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc);
let datetime: DateTime<Utc> = DateTime::from_naive_utc_and_offset(naive, Utc);
Ok(Self(datetime))
} else {
Err(TimeStampError::EmptyNaiveDateTime(
Expand Down

0 comments on commit 2376532

Please sign in to comment.