You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shelltool/git/time.sh

2 lines
315 B

#格式化输出git提交历史日期
git log --pretty=%cd|awk '{info=$0;gsub(/ /,"",info);cmd="echo 日期:`date -j -f ""%c%z"" "info" ""+%Y/%m/%d,%I:%M%p""`,时间戳:`date -j -f ""%c%z"" "info" +%s`";print system(cmd)}'|awk 'NR%2==0{next}{line=$0;gsub(/PM/," 下午",line);gsub(/AM/," 上午",line);print line}'