From f491e18e15c1575fb8ef9fa5097f07dc95e02883 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Tue, 6 Aug 2024 19:44:36 -0400 Subject: write batch_delmeme --- src/commands/meme/history.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/commands') diff --git a/src/commands/meme/history.rs b/src/commands/meme/history.rs index 335603f..9651ba1 100644 --- a/src/commands/meme/history.rs +++ b/src/commands/meme/history.rs @@ -1,3 +1,4 @@ +use chrono::TimeZone; use diesel::{ result::Error as DieselError, NotFound, @@ -133,7 +134,7 @@ pub async fn history(ctx: PoiseContext<'_>, n: Option) -> anyhow::Result< .then(|(i, rec)| async move { let mut conn = connection().await?; - let dt = chrono::DateTime::from_utc(rec.time, chrono::Utc {}); + let dt = chrono::Utc.from_utc_datetime(&rec.time); let ago = TIME_FORMATTER.convert((chrono::Utc::now() - dt).to_std().unwrap()); let rand = if rec.random { @@ -246,7 +247,7 @@ and *{}* was the most-memed overall ({})"#, (stats.audio_memes as f64) / (stats.memes_overall as f64) * 100., stats.image_memes, (stats.image_memes as f64) / (stats.memes_overall as f64) * 100., - stats.started_recording.date().format(CLEAN_DATE_FORMAT), + stats.started_recording.naive_local().date().format(CLEAN_DATE_FORMAT), TIME_FORMATTER.convert((chrono::Utc::now() - stats.started_recording).to_std().unwrap()), stats.total_meme_invocations, stats.random_meme_invocations, -- cgit v1.3.1