Setting the time zone similarly, in CentOS 7, a Setup Setup program called Timedatectl is introduced.
The usage is simple:
# timedatectl # View the various states of the system time
$timedatectl status
Local Time: Four the- A- - Ten: the:Tencstuniversal time: Four the- A- - Geneva: the:TenUTCRTC time: Four the- A- - Geneva: the:TenTimezone:asia/shanghai (CST, +0800) NTP enabled:yesntp SYNCHRONIZED:YESRTCinchLocal TZ:NODST active:n/A
# timedatectl List-timezones # List all time zones
# timedatectl SET-LOCAL-RTC 1 # Adjust the hardware clock to match the local clock, 0 for UTC time
# timedatectl Set-timezone Asia/shanghai # Set the system time zone to Shanghai
In fact, regardless of the distribution of the differences, from the bottom of the words, the time-zone modification is easier than imagined:
# Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
Entos 7 Time zone settings