【问题标题】:git log: How do I change the time zone and format of date at the same time?git log:如何同时更改时区和日期格式?
【发布时间】:2020-11-22 09:36:10
【问题描述】:

我在 Git Bash 中使用这个命令:

git log -1 --date=local --pretty=format:'%ad' ce40c0f8f02e83892eb185aabea306ee2a3ab10e

我想在本地时区显示日期并显示为DD-MMM-YYYY HH:MM:SS

似乎我可以将时区更改为本地 (--date=local) 或更改格式 (--date=format:'%d %b %Y %H:%M:%S'),但似乎不能同时进行。

【问题讨论】:

标签: git datetime formatting timezone git-log


【解决方案1】:

没关系,我明白了:

git log -1 --date='format-local:%d-%m-%Y %H:%M:%S' \
           --pretty=format:'%H; %s; %an; %ae; %ad; %cn; %ce; %cd' \
           ce40c0f8f02e83892eb185aabea306ee2a3ab10e

【讨论】:

    猜你喜欢
    • 2019-12-28
    • 2020-11-22
    • 1970-01-01
    • 2011-12-12
    • 1970-01-01
    • 2018-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多