mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 01:39:52 +08:00
修复shell获取时间
This commit is contained in:
1 parent
9f0503f138
commit
f016e6734a
2 files changed
+29
-16
No files matched your search
@@ -401,6 +401,17 @@ format_time() {
|
||||
fi
|
||||
}
|
||||
|
||||
format_log_time() {
|
||||
local format="$1"
|
||||
local time="$2"
|
||||
|
||||
if [[ $is_macos -eq 1 ]]; then
|
||||
echo $(date -j -f "$format" "$time" "+%Y-%m-%d-%H-%M-%S")
|
||||
else
|
||||
echo $(date -d "$time" "+%Y-%m-%d-%H-%M-%S")
|
||||
fi
|
||||
}
|
||||
|
||||
format_timestamp() {
|
||||
local format="$1"
|
||||
local time="$2"
|
||||
|
||||
Reference in new issue
Block a user