Skip to content

Commit a1958ca

Browse files
committed
Replace use of NativeDateTime::from_timestamp_opt
with DateTime::from_timestamp due to deprecation
1 parent f9da79a commit a1958ca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ pub fn parse_datetime_at_date<S: AsRef<str> + Clone>(
199199

200200
// Parse epoch seconds
201201
if let Ok(timestamp) = parse_timestamp(s.as_ref()) {
202-
if let Some(timestamp_date) = NaiveDateTime::from_timestamp_opt(timestamp, 0) {
203-
return Ok(date.offset().from_utc_datetime(&timestamp_date));
202+
if let Some(timestamp_date) = DateTime::from_timestamp(timestamp, 0) {
203+
return Ok(timestamp_date.into());
204204
}
205205
}
206206

0 commit comments

Comments
 (0)