Daily Archives: 2012 年 01 月 04 日

Hello World

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