One, view and modify the time zone of Linux 1. View current time zone
Command: "Date-r"
2. Modify the setup Linux Server time zone method A
Command: "Tzselect"
Method B is limited to Redhat Linux and CentOS
Command: "Timeconfig"
Method C applies to Debian
Command: "Dpkg-reconfigure tzdata"
3. Copy the appropriate time zone file, replace the system time zone file, or create a linked file
cp/usr/share/zoneinfo/$ main time zone/$ times time zone/etc/localtime
For example: In set China time zone use Asia/Shanghai (+8)
Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
4. Note
GMT (Greenwich Mean Time, GMT):
Refers to the standard time of the Royal Greenwich Observatory, located in the outskirts of London, as the Prime meridian is defined through the meridians there.
UTC (Universal time/temps
Cordonné World Standard Time)
CST (Central Standard Time national standard Time, one to say Zhongyuan time); Chinese Standard Time (China
Standard Time)
GMT + 8 = UTC + 8 = CST
Second, the time to view and modify Linux
1. Date
View system time
# date
Setting the system time
# date--set "07/07/06 10:19" (Month/day/year: minutes: seconds)
Writes the current time and date to the BIOS to avoid failure after a restart
Command: "Hwclock-w"
2, Hwclock/clock
Viewing hardware time
# Hwclock--show
or # clock--show
Set Hardware time
# Hwclock--set--date= "07/07/06 10:19" (Month/day/year: minutes: seconds)
or # clock--set--date= "07/07/06 10:19" (Month/day/year: minutes: seconds)
3. Synchronization of hardware time and system time
According to the foregoing, reboot the system, hardware time will read the system time, to achieve synchronization, but do not restart, you need to use the Hwclock or clock command to achieve synchronization.
The hardware clock is synchronized with the system clock:
# Hwclock--hctosys (HC stands for hardware time, SYS represents system time)
Or
# clock--hctosys
system clock and Hardware clock sync: # hwclock--SYSTOHC or # clock--SYSTOHC
For China time zone, modify the operation as follows 1. Modify a file
/etc/sysconfig/clockContent: Zone=asia/shanghai utc=false arc=false2. Rm/etc/localtimeln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime
Reprint: Under Linux View/modify system time zone, time