diff --git a/shell/otask.sh b/shell/otask.sh index b73fc3dd..516a9439 100755 --- a/shell/otask.sh +++ b/shell/otask.sh @@ -125,7 +125,8 @@ run_concurrent() { fi 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 local relative_path="${file_param%/*}" diff --git a/shell/share.sh b/shell/share.sh index 989c4431..b1850e6a 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -340,7 +340,7 @@ format_log_time() { local time="$2" 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 echo $(date -d "$time" "+%Y-%m-%d-%H-%M-%S-%3N") fi