天天看点

centos设置时钟同步时间

用ntpdate同步时间

clock -w 硬件同步

如果出错,看一下ntp服务是否启动,可以用service ntpd stop再试

如果clock和date时间不同

[xxx@mtg ~]# clock

2016年01月15日 星期五 10时34分39秒  -0.234710 seconds

[xxx@mtg ~]# date

2016年 01月 15日 星期五 10:42:12 CST

硬件时钟和系统时钟同步

[xxx@mtg ~]# hwclock --hctosys

2016年01月15日 星期五 10时37分37秒  -0.859714 seconds

2016年 01月 15日 星期五 10:37:41 CST

和时间服务器同步

[xxx@mtg ~]# ntpdate time.windows.com

15 Jan 10:45:45 ntpdate[28529]: step time server time.windows.com offset 449.438743 sec

2016年 01月 15日 星期五 10:45:50 CST

系统时钟和硬件时钟同步

[xxx@mtg ~]# hwclock --systohc

2016年 01月 15日 星期五 10:46:23 CST

2016年01月15日 星期五 10时46分28秒  -0.640991 seconds

本文转自 古老 51CTO博客,原文链接:http://blog.51cto.com/yzmlinux/1374180,如需转载请自行联系原作者

继续阅读