1

My Ubuntu 16.04.5 PC is located in Delhi, India.

I am trying to sync my system clock with USA NTP Server. In my system's /etc/ntp.conf file, I have used the following configuration:

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
# pool 0.ubuntu.pool.ntp.org iburst
# pool 1.ubuntu.pool.ntp.org iburst
# pool 2.ubuntu.pool.ntp.org iburst
# pool 3.ubuntu.pool.ntp.org iburst
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
server 3.us.pool.ntp.org

# Use Ubuntu's ntp server as a fallback.
# pool ntp.ubuntu.com

The output of ntpq -p is:

remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*hydrogen.consta 209.51.161.238   2 u   46   64  377  223.270  -93.650  47.200
+horp-bsd01.horp 152.2.133.54     2 u   47   64  377  271.806  -103.56  35.670
 ntpool1.603.new .XFAC.          16 u 1463  512    0    0.000    0.000   0.000
+69.10.161.7     195.205.216.85   3 u   30   64  377  268.569  -95.798  54.450

But my system is still in Indian Standard Time (IST). What am I doing wrong?

7
  • The NTP servers you use have nothing to do with your time zone.
    – Sacha K
    May 17, 2019 at 7:20
  • There is just one universal time that is provided by every time server. IST is just the way it is displayed on your local machine.
    – Jos
    May 17, 2019 at 7:20
  • @Jos, So whichever NTP Server I may put in the conf file, the system will always show the time in my timezone? Its located in /etc/timezone (Asia/Kolkata)
    – Anuj Kalra
    May 17, 2019 at 7:28
  • Yes. You can change your time zone from Settings - Details - Date and time.
    – Jos
    May 17, 2019 at 7:30
  • fyi: Check your system is up-to-date; 16.04.6 was released 1-March-2019, so your system should report 16.04.6 as its current release (unless you were providing what you installed, not your current system state).
    – guiverc
    May 17, 2019 at 7:38

1 Answer 1

3

NTP always distributes time in UTC. It does not matter where it's located.

Time zones are applied at your computer, and different users can have different time zones. Internally, Unix keeps track of time in UTC.

To change time zone, run sudo dpkg-reconfigure tzdata.

You can also change the timezone for a single command:

[~]$ TZ=UTC; date
Fri 17 May 07:34:05 UTC 2019
[~]$ TZ=CEST; date
Fri 17 May 07:34:07 CEST 2019
[~]$ TZ=EST; date
Fri 17 May 02:35:03 EST 2019
[~]$ 

Here I first show UTC time, then Central European Summertime (my local TZ), and then Eastern Standard Time, which is used in the eastern part of the United States.

When you select NTP servers, select local servers. This probably means indian servers. You want as low latency and low jitter as possible. This probably means you should use in.pool.ntp.org, unless you have special requirements.

3
  • The wifi devices that I am going to install is going to be in a different timezone. I want my AWS EC2 machine to be in sync with the Wi-Fi Device to ensure seamless communication between the two systems. The region of my AWS system is Mumbai (timezone Asia/Kolkata). This is why I want to sync my EC2 server with the same NTP from which my Wi-Fi device will take time.
    – Anuj Kalra
    May 17, 2019 at 8:38
  • Time zone does not matter for NTP synchronization. Time zone is simply added to the time before it's displayed. For the time to be accurate and precise you want to use local NTP servers. You should care about UTC time being in sync, and not care about time zone. Time zones are for the convenience of humans. For computer communication, stick with UTC.
    – vidarlo
    May 17, 2019 at 8:41
  • In addition, time synchronized to within a second is generally enough for most general computing purposes. Within one second is trivially achievable by NTP. You may have special requirements requiring more accurate time, but in that case you should spend some time on designing synchronization.
    – vidarlo
    May 17, 2019 at 8:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .