Merge pull request #11 from oscargus/removedeprecation

Replace deprecated method
This commit is contained in:
Frans Skarman 2023-09-18 17:37:43 +00:00 committed by GitHub
commit 14a314a2f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
// This program is distributed under both the GPLV3 license
// and the YEHOWSHUA license, both of which can be found at
// the root of the folder containing the sources for this program.
use chrono::prelude::{DateTime, Utc, TimeZone};
use chrono::prelude::{DateTime, Utc};
use itertools::Itertools;
use super::super::reader::{Cursor, WordReader, next_word};
@ -133,9 +133,9 @@ pub(super) fn parse_date(
// unfortunately, the minutes, seconds, and hour could occur in an
// unexpected order
let full_date = format!("{day} {month} {date} {hh}:{mm}:{ss} {year}");
let full_date = Utc.datetime_from_str(full_date.as_str(), "%a %b %e %T %Y");
let full_date = DateTime::parse_from_str(full_date.as_str(), "%a %b %e %T %Y");
if full_date.is_ok() {
return Ok(full_date.unwrap());
return Ok(full_date.unwrap().into());
}
Err(format!(