时间日期类
\color{blue}{\huge{时间日期类}}
时间日期类
date
![在这里插入图片描述](https://img-blog.csdnimg.cn/dd82174bd159440d8acb8902c6a835ac.png)
语法格式:
date
:显示当前时间信息,时间,日期。
❗❗❗❗
❗❗❗❗
❗❗❗❗使用date
查看年份与时间的时候,年份要用H
,是大写,其他信息都是小写。
查看日期的时候,都是用大写(H
、M
、S
)
查看日期:"+%Y-%m-%d"
查看时间:"+%H:%M:%S"
![在这里插入图片描述](https://img-blog.csdnimg.cn/8dd990e942754761820246f39be80d8d.png)
date -s 字符串时间
:将当前系统的时间,设置成后面的字符串时间。
cal
![在这里插入图片描述](https://img-blog.csdnimg.cn/f2fa9b15fce549ce969e282544838bd3.png)
语法格式::
cal
:显示当前月份的日历。
![在这里插入图片描述](https://img-blog.csdnimg.cn/28b78bcb7ba64999bc986edb485e3b69.png)
cal n
:显示n
年一整年的日历。
![在这里插入图片描述](https://img-blog.csdnimg.cn/595e74f851e84609b365c642d47bc54f.png)
cal 2020
显示2020
年整个年份的日历。