One, time zone
Show Time zone
Date--help Get help
Date-r
Date +%z
The above two commands are available
[Root@localhost ~]# date-r; Date +%z
Fri, Oct 23:34:27 +0800
+0800
The main one is the back +0800, East area eight.
Modify Time Zone
Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
Time zone information exists under/usr/share/zoneinfo/, the local time zone information exists/etc/localtime, using the tab skill, you can modify the time zone arbitrarily
Tzselect, interactive command, but it seems not too good, or use the above bar.
Second, Time
Concept: Linux time has two
System time: Also called software time (SYS), the number of seconds from January 1, 1970 to the current time
Bois time: Also called hardware time (HC)
Show time
[Root@localhost ~]# date;hwclock-r
October 19, 2012 Friday 23:39:44 CST
October 19, 2012 Friday 23:39 45 sec -0.317993 seconds
Set time
1, Date-s
Date-s 20121019
Date-s 23:40:00
You can use this if you don't have a network.
2, Ntpdate
Ntpdate time.windows.com && hwclock-w
Networking update time, if successful, will be system time, written to Bois
Hwclock-w or Hwclock--SYSTOHC
Can do in crontab
3, start the NTPD service, open after 2 can not be used.
Update with Ntpdate to make sure time doesn't vary too much
Rpm-qa | grep NTP #查询一下可安装了
Chkconfig--list | grep NTP #看下服务情况
CHKCONIFG ntpd on
Service ntpd start or/etc/init.d/ntpd start
If necessary, set the/etc/ntp.conf, and then reload the service.
The knowledge of NTP refer to the server chapter of Brother Bird