date 命令学习

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)


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值