修复shell获取时间

This commit is contained in:
whyour committed 2022-07-17 13:24:59 +08:00
1 parent 9f0503f138
commit f016e6734a
2 files changed
+29 -16

No files matched your search

+11
View File
@@ -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"