aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meme
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2024-08-06 19:44:36 -0400
committerNathan Perry <np@nathanperry.dev>2024-08-06 19:44:36 -0400
commitf491e18e15c1575fb8ef9fa5097f07dc95e02883 (patch)
treeaddd0f7249f57f0f6b68155d306731adb4567f7c /src/commands/meme
parent501ba27e1cd52741988113ef47ee0fad7d0a5799 (diff)
write batch_delmeme
Diffstat (limited to 'src/commands/meme')
-rw-r--r--src/commands/meme/history.rs5
1 files changed, 3 insertions, 2 deletions
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<usize>) -> 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,