From 51d3cef75fd38111cc8340574596ab6eaaaed7a7 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 18 Dec 2023 22:26:52 +0100 Subject: [PATCH] Display times in local timezone instead of UTC --- src/tui/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tui/mod.rs b/src/tui/mod.rs index 36253c3..e429446 100644 --- a/src/tui/mod.rs +++ b/src/tui/mod.rs @@ -1,6 +1,6 @@ use std::ops::Deref; use std::sync::{Arc}; -use chrono::{Duration, Utc}; +use chrono::{Duration, Local, Utc}; use tokio::sync::{RwLock, RwLockReadGuard}; use tokio::time::sleep; use crate::{SharedData}; @@ -25,13 +25,14 @@ async fn print_info<'a>(data: RwLockReadGuard<'a, SharedData>, min_len_series: & print!("\x1B[2J\x1B[1;1H"); println!( "##[Ascendance of a Bookworm Bot]## | Time: {}", - Utc::now().naive_local().format("%H:%M:%S") + Local::now().naive_local().format("%H:%M:%S") ); println!("Instance: {}", data.config.instance); println!( "Ran Last: {} | Config Reload Interval: {}", data .start + .with_timezone(&Local) .naive_local() .format("%d/%m/%Y %H:%M:%S"), data.config.config_reload_seconds