Display times in local timezone instead of UTC

This commit is contained in:
Neshura 2023-12-18 22:26:52 +01:00
parent 57c9891d9b
commit 51d3cef75f
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -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