date +%F' '%T
date +%%
%
a literal % 字面意义的%
%a locale's abbreviated weekday name (e.g., Sun)
date +%a
Mon
date +%A
Monday
date +%B
July
date +%c
本地时间
date +%C
世纪
date +%d------
31 一个月中第几日
date +%D
07/31/23 日/月/年
[mysql@rel7 ~]$ date +%e
31 跟%d 类似
date +%F %F full date; same as %Y-%m-%d
2023-07-31 年月日
date +%g
23 只显示年的后两位
date +%G
2023 完整年份
[mysql@rel7 ~]$ date +%h
Jul 跟%b类似
date +%H
10 小时 这个是(0---23)
date +%I
10 小时 (0-12)
date +%j
212
一年中第几天
date +%k
10 类似于%_H
date +%l
10 类似于%_I
date +%m
07 月份
date +%M
58
分钟
date +%n 换行符-
%n a newline
date +%N
728823195 纳秒
date +%p
PM pm或者am
[mysql@rel7 ~]$ date +%P
pm 小写
date +%r
03:29:15 PM 12小时制
date +%R
15:33 24小时时分
date +%s
1690788924 从1970年计算秒
date +%S 00-60秒
14
date +%t tab键
date +%T 时分秒 类似 %H:%M:%S %T time; same as %H:%M:%S
15:38:44
date +%u 周一到周日
1
date +%U 一年中第几周
31
%U week number of year, with Sunday as first day of week (00..53)
%V ISO week number, with Monday as first day of week (01..53)
%w day of week (0..6); 0 is Sunday
[mysql@rel7 ~]$ date +%w
1
%W week number of year, with Monday as first day of week (00..53)
date +%W
31
date +%x
07/31/2023
%x locale's date representation (e.g., 12/31/99)
date +%X
04:11:42 PM
%X locale's time representation (e.g., 23:13:48)
date +%y
23
last two digits of year (00..99)
date +%Y
2023
%z +hhmm numeric time zone (e.g., -0400)
%:z +hh:mm numeric time zone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
%Z alphabetic time zone abbreviation (e.g., EDT)