CentOS 7 modify the time zone
The style of most software in the Linux system (I specifically refer to the release version, but did not mention the kernel) is that the backward compatibility will not be carefully considered. For example, if you can use this program configuration in the previous version, you may have reached the next version, the program has disappeared. for example, sysvinit.
Set the time zone similarly. In CentOS 7, a setup program called timedatectl is introduced.
Easy to use:
# Timedatectl # view various states of the system timeLocal time: 42014-12-25 10:52:10 CST Universal time: 42014-12-25 02:52:10 utc rtc time: 42014-12-25 02:52:10 Timezone: Asia/Shanghai (CST, + 0800) NTP enabled: yesNTP synchronized: yes RTC in local TZ: no DST active: n/
# Timedatectl list-timezones# List all time zones
# Timedatectl set-local-rtc 1# Adjust the hardware clock to be consistent with the local clock, and set 0 to UTC time.
# Timedatectl set-timezone Asia/Shanghai# Set the system time zone to Shanghai
In fact, without considering the differences between different releases, it is easier to modify the time zone from the lower layer:
# Cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime