Refactor tool execution pipeline
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
//! datetime — 本地时间
|
||||
|
||||
use chrono::Local;
|
||||
|
||||
fn main() {
|
||||
let _ = std::io::stdin().read_line(&mut String::new());
|
||||
let now = Local::now();
|
||||
let out = serde_json::json!({
|
||||
"type": "result",
|
||||
"content": format!("当前时间: {}\n星期: {}\n时区: {}",
|
||||
now.format("%Y-%m-%d %H:%M:%S"), now.format("%A"), now.offset())
|
||||
});
|
||||
println!("{out}");
|
||||
}
|
||||
Reference in New Issue
Block a user