From 7e8e2a6ce6d96ffa31c202ead6f31f18dc73c618 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sun, 1 Dec 2024 10:06:20 +0800 Subject: feat: append shell execute command to history file (#1026) --- src/utils/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/utils/mod.rs') diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 873c5c8..5271571 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -35,8 +35,11 @@ lazy_static::lazy_static! { } pub fn now() -> String { - let now = chrono::Local::now(); - now.to_rfc3339_opts(chrono::SecondsFormat::Secs, false) + chrono::Local::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, false) +} + +pub fn now_timestamp() -> i64 { + chrono::Local::now().timestamp() } pub fn get_env_name(key: &str) -> String { -- cgit v1.2.3