mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复 mac 时间格式化
This commit is contained in:
parent
3f71f9acdb
commit
6ea8d361fd
|
@ -125,7 +125,8 @@ run_concurrent() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
handle_env_split
|
handle_env_split
|
||||||
single_log_time=$(date "+%Y-%m-%d-%H-%M-%S.%3N")
|
time=$(date "+$mtime_format")
|
||||||
|
single_log_time=$(format_log_time "$mtime_format" "$time")
|
||||||
|
|
||||||
cd $dir_scripts
|
cd $dir_scripts
|
||||||
local relative_path="${file_param%/*}"
|
local relative_path="${file_param%/*}"
|
||||||
|
|
|
@ -340,7 +340,7 @@ format_log_time() {
|
||||||
local time="$2"
|
local time="$2"
|
||||||
|
|
||||||
if [[ $is_macos -eq 1 ]]; then
|
if [[ $is_macos -eq 1 ]]; then
|
||||||
echo $(date -j -f "$format" "$time" "+%Y-%m-%d-%H-%M-%S-%3N")
|
echo $(python3 -c 'from datetime import datetime; print(datetime.now().strftime("%Y-%m-%d-%H-%M-%S-%f")[:-3])')
|
||||||
else
|
else
|
||||||
echo $(date -d "$time" "+%Y-%m-%d-%H-%M-%S-%3N")
|
echo $(date -d "$time" "+%Y-%m-%d-%H-%M-%S-%3N")
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user