Skip to content

Commit bbcafc4

Browse files
committed
Replace use of NativeDateTime::from_timestamp_opt
with DateTime::from_timestamp due to deprecation
1 parent 1570d92 commit bbcafc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)