From bbcafc42f9257be107d106fda376855e1ae00c8b Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Sat, 4 May 2024 15:02:34 +0200 Subject: [PATCH] Replace use of NativeDateTime::from_timestamp_opt with DateTime::from_timestamp due to deprecation --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4d634f4..547031c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -199,8 +199,8 @@ pub fn parse_datetime_at_date + Clone>( // Parse epoch seconds if let Ok(timestamp) = parse_timestamp(s.as_ref()) { - if let Some(timestamp_date) = NaiveDateTime::from_timestamp_opt(timestamp, 0) { - return Ok(date.offset().from_utc_datetime(×tamp_date)); + if let Some(timestamp_date) = DateTime::from_timestamp(timestamp, 0) { + return Ok(timestamp_date.into()); } }