Linux 设定 系统时间

查看:
[root@localhost ~]# date
六 11月 29 21:34:40 CST 2008

设定:
[root@localhost ~]# date 112921242008.29
六 11月 29 21:24:29 CST 2008
格式:date 月日时分年.秒
date -s 11/29/08
date -s 11:29:29

把系统时间强制写入CMOS
[root@localhost ~]# hwclock -w

查看:
[root@localhost ~]# hwclock –show
2008年11月29日 星期六 01时34分43秒 -0.406003 seconds
设定:
[root@localhost ~]# hwclock –set –date=”11/29/2008 22:29:00″
[root@localhost ~]# hwclock
2008年11月29日 星期六 22时29分11秒 -0.321602 seconds
系统时间和硬件时间的同步:
[root@localhost ~]# hwclock –hctosys
[root@localhost ~]# hwclock –systohc
–hctosys set the system time from the hardware clock
–systohc set the hardware clock to the current system time
——–
参考:http://apps.hi.baidu.com/share/detail/31218645

2 Comments

  • fuhao
    2012 年 01 月 04 日 - 下午 3:07 | Permalink

    最好用ntpdate 同步时间服务器,这样更准

    • admin
      2012 年 04 月 04 日 - 上午 10:21 | Permalink

      /usr/sbin/ntpdate asia.pool.ntp.org

  • 发表评论

    电子邮件地址不会被公开。 必填项已用 * 标注

    *

    *