本文参考过网络文章,这是自己练习后总结的文档:
[root@sslinux ~]# date -s 07/19/2015 设置日期
2015年 07月 19日 星期日 00:00:00 CST
[root@sslinux ~]# date -s 21:02:30 设置时间
2015年 07月 19日 星期日 21:02:30 CST
[root@sslinux ~]# date 071921052015.20 同时设置日期时间(MMDDhhmmYYYY.ss)
2015年 07月 19日 星期日 21:05:20 CST
[root@sslinux ~]# date 查看系统时间
2015年 07月 19日 星期日 21:40:18 CST
查看系统硬件时钟即BIOS时间
[root@sslinux ~]# hwclock --show或者clock --show
2015年07月19日 星期日 20时56分28秒 -0.299828 seconds
设置系统硬件时间
[root@sslinux ~]# hwclock --set --date="07/19/1521:26:30"
[root@sslinux ~]# hwclock--show
2015年07月19日 星期日 21时26分36秒 -0.766557 seconds
[root@sslinux ~]# clock --set --date="07/19/1521:26:30"
[root@sslinux ~]#clock --show
2015年07月19日 星期日 21时26分34秒 -0.563807 seconds
同步系统及硬件时钟
[root@sslinux ~]# hwclock --systohc 硬件BIOS时间设置成系统时间
[root@sslinux ~]# clock --systohc 同上
[root@sslinux ~]# hwclock --hctosys 系统时间设置成硬件BIOS时间
[root@sslinux ~]# clock --hctosys 同上
转载于:https://blog.51cto.com/sz659918615/1676183