mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
test what local time returns
This commit is contained in:
parent
4ec0eda2b5
commit
b702a68c1c
1 changed files with 5 additions and 1 deletions
|
|
@ -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" => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue