replace chrono with time

This commit is contained in:
2023-01-07 13:48:50 +01:00
parent 1333b1f02f
commit d3f2aeb220
3 changed files with 7 additions and 163 deletions
+2 -2
View File
@@ -12,6 +12,7 @@ use std::collections::HashMap;
use std::fmt::Display;
use std::ops::RangeInclusive;
use std::time::Duration;
use time::OffsetDateTime;
use tokio::sync::mpsc;
const DEFAULT_CONTEST_DURATION: Duration = Duration::from_secs(60);
@@ -164,8 +165,7 @@ async fn run_contest(
contests: &Contests,
pin: bool,
) -> serenity::Result<Contest> {
let end_timestamp =
(chrono::Utc::now() + chrono::Duration::from_std(duration).unwrap()).timestamp() + 1;
let end_timestamp = (OffsetDateTime::now_utc() + duration).unix_timestamp();
// send announcement message
let announcement = channel_id