Gong
centos系统下服务器修改时间日期
使用 date 命令查看时间。
[root@localhost ~]# date
2021年 01月 06日 星期三 20:18:28 CST
将时间设置为20点16分30秒。
[root@localhost ~]# date -s 20:16:30
2021年 01月 06日 星期三 20:16:30 CST
将日期设置为2022年7月18日
[root@localhost ~]# date -s 07/18/22
2022年 07月 18日 星期一 00:00:00 CST
使用 hwclock -w 命令将系统时间同步到硬件时间。
hwclock --show : 查看硬件时间
[root@localhost ~]# hwclock -w
[root@localhost ~]# hwclock --show
2022年07月18日 星期一 00时02分19秒 -1.042103 秒