From b702a68c1c40a69f8d0f0b2a315566e7ac2da03e Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 29 Nov 2025 01:01:24 +0800 Subject: [PATCH] test what local time returns --- services/bao-console/src/cmds/test.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/bao-console/src/cmds/test.rs b/services/bao-console/src/cmds/test.rs index f34588b74..21194bdf2 100644 --- a/services/bao-console/src/cmds/test.rs +++ b/services/bao-console/src/cmds/test.rs @@ -38,13 +38,15 @@ impl<'a> ShellCmdApi<'a> for Test { } } "time" => { - use chrono::Utc; + use chrono::{Local, Utc}; let systime = std::time::SystemTime::now(); let epoch = systime.duration_since(std::time::SystemTime::UNIX_EPOCH).unwrap(); log::info!("Seconds since epoch: {}", epoch.as_secs()); log::info!("Systime: {:?}", systime); let now = Utc::now(); log::info!("UTC now {}", now.format("%Y-%m-%d %H:%M:%S UTC")); + let local_now = Local::now(); + log::info!("Local time: {}", local_now.format("%Y-%m-%d %H:%M:%S %Z")); log::info!("Waiting 3 seconds"); std::thread::sleep(std::time::Duration::from_secs(3)); @@ -55,6 +57,8 @@ impl<'a> ShellCmdApi<'a> for Test { log::info!("Systime: {:?}", systime); let now = Utc::now(); log::info!("UTC now {}", now.format("%Y-%m-%d %H:%M:%S UTC")); + let local_now = Local::now(); + log::info!("Local time: {}", local_now.format("%Y-%m-%d %H:%M:%S %Z")); } #[cfg(feature = "bmp180")] "temp" => {