Linux time and date commands

date command

Basic grammar

date
date +%Y
date +%m
date +%d
date “+%Y-%m-%d%H:%M:%S”

date -s 字符串时间(重点)

Function description
Display the current time
Display the current year
Display the current month
Display the current day
Display the year, month, day , hour, minute and second
Set the time

Actual demonstration
Insert picture description here
Insert picture description here

date command

Basic grammar

cal option

Function description
View calendar instructions

Actual demonstration
Insert picture description here

Guess you like

Origin blog.csdn.net/magicproblem/article/details/110505634