Through Date-s "2014-12-06 15:00:00" and timedatectl set-time "2014-12-06 15:00:00", as well as NTP and other methods are temporarily effective, distressed me half a day. Talk less, straight to the subject.
Step 1: Check the time to discover that local times is not correct, and universal is right. Then set the local time to: UTC (World Standard Time) No, it's OK.
[[email protected] ~] $ timedatectl
Local time: Sat 2014-12-06 22:59:33 CST # 8 more hours live
Universal time: Sat 2014-12-06 14:59:33 UTC
Timezone: Asia / Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n / a
[[email protected] ~] $
Step 2: View system time zone information
[[email protected] ~]$ ls /usr/share/zoneinfo/ Africa Chile GB Indian MST PRC UTC
America CST6CDT GB-Eire Iran MST7MDT PST8PDT WET
Antarctica Cuba GMT iso3166.tab Navajo right W-SU
Arctic EET GMT0 Israel NZ ROC zone.tab
Asia Egypt GMT-0 Jamaica NZ-CHAT ROK Zulu
Atlantic Eire GMT+0 Japan Pacific Singapore
Australia EST Greenwich Kwajalein Poland Turkey
Brazil EST5EDT Hongkong Libya Portugal UCT
Canada Etc HST MET posix Universal CET Europe Iceland Mexico posixrules US
[[email protected] ~]$
Step 3: Delete the current system's time zone:
[[email protected] ~]$ sudo rm /etc/localtime
Step 4: Create a soft connection from/usr/share/zoneinfo/to replace the current time zone information and select Universal directly:
[[email protected] ~]$ sudo ln -s /usr/share/zoneinfo/Universal /etc/localtime
[[email protected] ~]$
Step 5: Use timedatectl to view, OK problem solved.
[[email protected] ~]$ sudo timedatectl
Local time: Sat 2014-12-06 15:10:39 UTC
Universal time: Sat 2014-12-06 15:10:39 UTC
RTC time: Sat 2014-12-06 07:11:04 Timezone: Universal (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
Note: CentOS linux:setting timezone and synchronizing time with NTP
CentOS 7 resolves a 8-hour difference between local time and actual times