summaryrefslogtreecommitdiffstats
path: root/src/utils/mod.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-12-01 10:06:20 +0800
committerGitHub <noreply@github.com>2024-12-01 10:06:20 +0800
commit7e8e2a6ce6d96ffa31c202ead6f31f18dc73c618 (patch)
tree907070ab6f81ebef46a1ae8793b553c99b2dd52e /src/utils/mod.rs
parentefdec3497976ddb2e35e6302ee68f3d753f837a3 (diff)
downloadaichat-7e8e2a6ce6d96ffa31c202ead6f31f18dc73c618.tar.gz
feat: append shell execute command to history file (#1026)
Diffstat (limited to 'src/utils/mod.rs')
-rw-r--r--src/utils/mod.rs7
1 files changed, 5 insertions, 2 deletions
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 {