Replace use of NativeDateTime::from_timestamp_opt

with DateTime::from_timestamp due to deprecation
This commit is contained in:
Daniel Hofstetter
2024-05-04 15:02:34 +02:00
parent 1570d92fc5
commit bbcafc42f9
+2 -2
View File
@@ -199,8 +199,8 @@ pub fn parse_datetime_at_date<S: AsRef<str> + 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(&timestamp_date));
if let Some(timestamp_date) = DateTime::from_timestamp(timestamp, 0) {
return Ok(timestamp_date.into());
}
}