We use the command below to find out the current system time:
If it's incorrect and we wish to change it, we can issue a command below:
where
nn = month of the year (01 to 12)
dd = day of the month (01 to 31)
hh = hour of the day (00 to 23)
mm = minute of the hour (00 to 59)
cc = The first to digits of the year
yy = The last two digits of the year
.ss = The seconds
Here's the command to find out the hardware clock:
To make it consistent with the system time, command like this:
If we wanna keep it on time automatically, install ntp.
date
If it's incorrect and we wish to change it, we can issue a command below:
date nnddhhmm[[cc]yy][.ss]
where
nn = month of the year (01 to 12)
dd = day of the month (01 to 31)
hh = hour of the day (00 to 23)
mm = minute of the hour (00 to 59)
cc = The first to digits of the year
yy = The last two digits of the year
.ss = The seconds
Here's the command to find out the hardware clock:
hwclock --show
To make it consistent with the system time, command like this:
hwclock --hctosys
If we wanna keep it on time automatically, install ntp.
本文介绍了如何在Linux系统中查看和调整系统时间及硬件时钟,包括使用date命令修改系统时间,通过hwclock命令同步硬件时钟与系统时间,以及安装ntp服务实现自动时间同步。
1064

被折叠的 条评论
为什么被折叠?



