One, time zone configuration
Show Time zone
[Email protected] ~]# date-r
Mon, Dec 2016 14:02:47 +0800
[Email protected] ~]#
[Email protected] ~]# date +%z
+0800
[Email protected] ~]#
The main is the back of the +0800, East eight district
Modify Time Zone
[Email protected] ~]# Vim/etc/sysconfig/clock
[Email protected] ~]# Cat/etc/sysconfig/clock
Zone= "Asia/shanghai"
[Email protected] ~]# Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
Cp:overwrite '/etc/localtime '? Y
[Email protected] ~]#
The time zone information exists/usr/share/zoneinfo/below, the local time zone information exists/etc/localtime, using the TAB key technique, can modify the time zone arbitrarily.
Tzselect, interactive command, I tried useless effect, not recommended.
Second, time-related directives
Concept: There are 2 Linux time
System time: Also called software time (SYS), January 1, 1970 to the current time of the number of seconds
BIOS time: Also called hardware time (HC)
Display time:
[[Email protected] ~]# date 121914372015
Saturday, December 19, 2015 14:37:00 CST
[Email protected] ~]#
[Email protected] ~]# Hwclock-r
December 19, 2016 Monday 14:37 58 sec -0.523154 seconds
[Email protected] ~]#
[Email protected] ~]# hwclock-w
[Email protected] ~]# Hwclock-r
December 19, 2015 Saturday 14:37 29 sec -1.054204 seconds
[Email protected] ~]#
[Email protected] ~]#
Note:
Format the date:
#date mmddhhmmyyyy
MM: Month
DD: Date
HH: Hours
MM: Minutes
YYYY: The Public
#hwclock [RW]
-R: That is read, reading the current time parameters in the BIOS
-W: Write, writes the current Linux system time to the BIOS
Linux Web-time:
#ntpdate [NTP Ip/hostname]
For example:
#ntpdate time.windows.com
This article is from the "Behind" blog, make sure to keep this source http://laozhu.blog.51cto.com/755494/1883967
Linux System Time Management