From 6ea8d361fda843f5f6e7c4796ac025029229440f Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 29 Sep 2024 22:47:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20mac=20=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/otask.sh | 3 ++- shell/share.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/otask.sh b/shell/otask.sh index b73fc3dd3f1..516a9439135 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 989c44313a4..b1850e6a481 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