diff options
Diffstat (limited to 'src/commands/meme/history.rs')
| -rw-r--r-- | src/commands/meme/history.rs | 5 |
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, |
