Skip to main content
How to use ntpd to setup and sync Hong Kong Time From Gov 2018
- First install NTP using: yum install -y ntpd (CentOS) or sudo apt install -y ntpd (Ubuntu)
- Edit the ntp config file. Under CentOS it is /etc/ntp.conf
- Find the section where it shows:
- server 0.centos.pool.ntp.org iburst
- server 1.centos.pool.ntp.org iburst
- server 2.centos.pool.ntp.org iburst
- server 3.centos.pool.ntp.org iburst
- Comment it out (Adding # at the beginning of each line):
- # server 0.centos.pool.ntp.org iburst
- # server 1.centos.pool.ntp.org iburst
- # server 2.centos.pool.ntp.org iburst
- # server 3.centos.pool.ntp.org iburst
- Add the following line (as of 10 Dec 2018 from pool.ntp.org). No need to put # at the beginning. For latest server list please go to: https://www.ntppool.org/zone/hk
- server stdtime.gov.hk prefer
- server 2.hk.pool.ntp.org
- server 2.asia.pool.ntp.org
- server 0.asia.pool.ntp.org
- Save the file and exit.
- Final output:

- Stop the service first:
- systemctl stop ntpd.service
- After stopping the service, trigger the synchronization by typing: ntpd -gq to force the sync. If success, it will take a while (few seconds) to do so.
- Check the time by typing: date
- Start the service again by typing: systemctl start ntpd.service
Comments