Skip to content

Commit

Permalink
DateTime::from_utc() is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhammes committed May 26, 2024
1 parent dbd5df7 commit e1fd71d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::{DateTime, Datelike, Days, NaiveDate, NaiveTime, Utc, Weekday};
use chrono::{DateTime, Datelike, Days, NaiveDate, NaiveTime, Weekday};
use futures::future::join_all;
use std::collections::BTreeMap;
use std::time::Duration;
Expand All @@ -7,12 +7,10 @@ use std::time::Duration;
async fn main() {
println!("Hello, world!");

let start = DateTime::<Utc>::from_utc(
NaiveDate::from_isoywd_opt(2023, 1, Weekday::Mon)
.unwrap()
.and_time(NaiveTime::from_hms_opt(0, 0, 0).unwrap()),
Utc,
);
let start = NaiveDate::from_isoywd_opt(2023, 1, Weekday::Mon)
.unwrap()
.and_time(NaiveTime::from_hms_opt(0, 0, 0).unwrap())
.and_utc();
let dates: Vec<NaiveDate> = vec![
start,
start + Days::new(1),
Expand Down

0 comments on commit e1fd71d

Please sign in to comment.