Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC)。
    系统时间:指当前Linux Kernel中的时间。
    硬件时间:主板上有电池供电的时间。

    查看系统时间的命令:

    1. date

    查看硬件时间的命令:

    1. hwclock

    下面介绍一下与时间服务器上的时间同步的方法
    1.安装ntpdate工具

    1. yum -y install ntp ntpdate

    2.设置系统时间与网络时间同步

    1. ntpdate cn.ntp.org.cn

    时间同步服务器查询: http://www.ntp.org.cn

    3.硬件时间和系统时间之间同步

    1. hwclock --systohc #将系统时间写入硬件时间
    2. hwclock --hctosys #将硬件时间写入系统时间

    4.强制系统时间写入CMOS中防止重启失效

    1. hwclock -w
    2. clock -w