CentOS 7 resolves a 8-hour difference between local time and actual times

Source: Internet
Author: User



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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.