修复 mac 时间格式化

This commit is contained in:
whyour
2024-09-29 22:47:57 +08:00
parent 3f71f9acdb
commit 6ea8d361fd
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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