git --date=xxxx 参数 【汇总】

git --date 常用参数


详细使用说明: https://www.cnblogs.com/wutou/p/17493337.html


其他的格式化占位符如下:

-- date=format:relative:'5 seconds ago'
-- date=format:relative:'5 minutes ago'
-- date=format:relative:'5 hours ago'
-- date=format:relative:'5 days ago'
-- date=format:relative:'3 weeks ago'
-- date=format:relative:'5 months ago'
-- date=format:relative:'1 year, 2 months ago'
-- date=format:relative:'1 year, 9 months ago'
-- date=format:relative:'20 years ago'

-- date=format:relative:now

-- date=format:relative:'6am yesterday'
-- date=format:relative:'6pm yesterday'
-- date=format:relative:'3:00'
-- date=format:relative:'15:00'
-- date=format:relative:'noon today'
-- date=format:relative:'noon yesterday'

-- date=format:relative:'last tuesday'
-- date=format:relative:'July 5th'
-- date=format:relative:'06/05/2009'
-- date=format:relative:'06.05.2009'

-- date=format:relative:'Jun 6, 5AM'
-- date=format:relative:'5AM Jun 6'
-- date=format:relative:'6AM, June 7, 2009'


选项(参数) 中文说明 英文说明
%a 星期的缩写 Abbreviated weekday name
%A 星期的全名 Full weekday name
%b 月份的缩写 Abbreviated month name
%B 月份的全称 Full month name
%c 适用于区域设置的日期和时间表示 Date and time representation appropriate for locale
%d 月中的天作为十进制数字(01 – 31) Day of month as decimal number (01 – 31)
%H 24小时制的小时(00 – 23) Hour in 24-hour format (00 – 23)
%I 12小时格式的小时(01 – 12) Hour in 12-hour format (01 – 12)
%j 一年中的天作为十进制数字(001 – 366) Day of year as decimal number (001 – 366)
%m 以十进制数字表示的月份(01 – 12) Month as decimal number (01 – 12)
%M 分钟以十进制数字表示(00 – 59) Minute as decimal number (00 – 59)
%p 当前语言环境的"上午/下午",12小时制的指示器 Current locale's A.M./P.M. indicator for 12-hour clock
%S 秒作为十进制数字(00 – 59) Second as decimal number (00 – 59)
%U 一年中的周为十进制数字,周日为一周的第一天(00 – 53) Week of year as decimal number, with Sunday as first day of week (00 – 53)
%w 工作日为十进制数字(0 – 6;星期日为0) Weekday as decimal number (0 – 6; Sunday is 0)
%W 一年中的星期作为十进制数字,星期一作为星期的第一天(00 – 53) Week of year as decimal number, with Monday as first day of week (00 – 53)
%x 当前语言环境的日期表示 Date representation for current locale
%X 当前语言环境的时间表示 Time representation for current locale
%y 无世纪的年份,为十进制数字(00 – 99),也就是年份没有前两位
%Y 带世纪的年份,以十进制数表示
%z %Z:时区名称或时区缩写,取决于注册表设置; 如果时区未知,则没有字符
%% 表示百分号

https://www.cnblogs.com/wutou/p/17622253.html (git 相关优秀【网站链接】)



posted @ 2023-07-09 10:36  悟透  阅读(130)  评论(0编辑  收藏  举报