You are not logged in.

#1 2017-04-04 17:15:14

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

[SOLVED] dpkg-reconfigure tzdata leads to wrong time

Kind of annoying "feature". It is now 14:32 local time (17:02 UTC)

$ sudo dpkg-reconfigure tzdata

Current default time zone: 'America/St_Johns'
Local time is now:      Tue Apr  4 12:02:41 NDT 2017.
Universal Time is now:  Tue Apr  4 14:32:41 UTC 2017.

So both time zones are late by 2.5 hours (NDT is the correct time zone). The 2.5 hours lag also corresponds to the time difference between UTC and NDT). I am connected to a business network, may it have something to do with this? I don't remember having this problem from home...

This solution did not help.

Last edited by cyrf0006 (2018-04-12 18:06:35)

Offline

#2 2017-04-04 17:31:50

nobody
The Great
Registered: 2015-08-10
Posts: 3,655

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Dual-booting Windows? -> https://wiki.archlinux.org/index.php/ti … local_time

Otherwise, install ntp.

Offline

#3 2017-04-04 18:31:00

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Dual boot, indeed!

From the post referred above, this solution worked from the Windows partition:

Alternatively, create a *.reg file (on the desktop) with the following content and double-click it to import it into registry:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=qword:00000001

(Note the "qword" used, "dword" did not work)

Many thanks!

Offline

#4 2017-04-05 14:47:06

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

cyrf0006 wrote:

Dual boot, indeed!

From the post referred above, this solution worked from the Windows partition:

Alternatively, create a *.reg file (on the desktop) with the following content and double-click it to import it into registry:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=qword:00000001

(Note the "qword" used, "dword" did not work)

Many thanks!

nice, thanks for sharing some windows fu!

Offline

#5 2018-04-04 20:18:25

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

I hijack my own post.

I have the same time problem as stated above, but this time I am not on a dual-boot machine. I installed ntp but did not change the result. Any idea?

Offline

#6 2018-04-04 21:36:25

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,076
Website

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Please post the output of:

timedatectl | grep local

Offline

#7 2018-04-05 11:47:13

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

$ timedatectl | grep local
 RTC in local TZ: no

The problem is that my universal time is wrong, although timedatectl returns:

     NTP enabled: yes
NTP synchronized: yes

Last edited by cyrf0006 (2018-04-05 12:09:50)

Offline

#8 2018-04-05 13:05:07

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,076
Website

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Let's double check:

sudo timedatectl set-ntp true

^ Turn it on.

timedatectl status

^ Please post the full output, thanks!

There may be some clues in the journal (or maybe not):

sudo journalctl -u systemd-timesyncd --since=today

Offline

#9 2018-04-05 13:56:19

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Indeed it looks that the problem is here:

$ sudo journalctl -u systemd-timesyncd --since=today
[sudo] password for cyrf0006: 
-- Logs begin at Thu 2018-04-05 03:32:41 NDT, end at Thu 2018-04-05 05:19:20 NDT. --
Apr 05 03:32:41 orwell systemd[1]: Starting Network Time Synchronization...
Apr 05 03:32:41 orwell systemd[1]: Started Network Time Synchronization.
Apr 05 03:33:12 orwell systemd-timesyncd[439]: Using NTP server 144.217.65.183:123 (2.debian.pool.ntp.org).
Apr 05 03:33:22 orwell systemd-timesyncd[439]: Timed out waiting for reply from 144.217.65.183:123 (2.debian.pool.ntp.org).
...

I don't think it is a network issue because the same NTP config (/etc/ntp.conf) runs on my laptop without time out issue.

I've re-started (even re-installed ntp) without success..

Offline

#10 2018-04-05 16:32:01

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,076
Website

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

cyrf0006 wrote:
Apr 05 03:33:22 orwell systemd-timesyncd[439]: Timed out waiting for reply from 144.217.65.183:123 (2.debian.pool.ntp.org).
...

Hmmm...

Puffy:~$ nslookup 2.debian.pool.ntp.org                    
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   2.debian.pool.ntp.org
Address: 178.62.250.107
Name:   2.debian.pool.ntp.org
Address: 178.62.16.103
Name:   2.debian.pool.ntp.org
Address: 145.239.118.233
Name:   2.debian.pool.ntp.org
Address: 195.195.221.100

Puffy:~$

Do you get the same result?

https://packages.debian.org/stretch/dnsutils

EDIT: the IP address in the output is pingable (is that a word?).

Last edited by Head_on_a_Stick (2018-04-05 16:32:50)

Offline

#11 2018-04-05 17:04:04

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

HoaS wrote:

Do you get the same result?

Same style, but different IPs:

$ nslookup 2.debian.pool.ntp.org  
Server:		142.2.13.34
Address:	142.2.13.34#53

Non-authoritative answer:
Name:	2.debian.pool.ntp.org
Address: 206.108.0.132
Name:	2.debian.pool.ntp.org
Address: 66.70.172.17
Name:	2.debian.pool.ntp.org
Address: 144.217.65.184
Name:	2.debian.pool.ntp.org
Address: 144.217.75.74

These addresses are however not pingable (except the "Server" one), but I was not too concerned about that because I can't ping them from my laptop on which NTP time is okay.

Offline

#12 2018-04-05 18:03:55

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,076
Website

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Can you reach 144.217.65.183?

Do you have a file at /etc/systemd/timesyncd.conf?

Offline

#13 2018-04-05 19:40:55

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

HoaS wrote:

Can you reach 144.217.65.183?

No. I'll try later outside the firewall...

HoaS wrote:

Do you have a file at /etc/systemd/timesyncd.conf?

Yes. Everything is commented though.

Offline

#14 2018-04-05 21:57:54

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,076
Website

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Hold on a minute, we're not supposed to use `nslookup` any more, apparently

EDIT: or maybe it is OK, I'm getting all confused now.

Double check with:

dig 2.debian.pool.ntp.org

Last edited by Head_on_a_Stick (2018-04-05 21:59:28)

Offline

#15 2018-04-09 18:18:28

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

$ dig 2.debian.pool.ntp.org

; <<>> DiG 9.9.5-9+deb8u15-Debian <<>> 2.debian.pool.ntp.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37336
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;2.debian.pool.ntp.org.		IN	A

;; ANSWER SECTION:
2.debian.pool.ntp.org.	108	IN	A	66.70.172.17
2.debian.pool.ntp.org.	108	IN	A	158.69.125.231
2.debian.pool.ntp.org.	108	IN	A	159.203.8.72
2.debian.pool.ntp.org.	108	IN	A	158.69.226.90

;; Query time: 24 msec
;; SERVER: 142.2.13.34#53(142.2.13.34)
;; WHEN: Fri Apr 06 10:16:48 NDT 2018
;; MSG SIZE  rcvd: 114

UPDATE:

HoaS wrote:

Can you reach 144.217.65.183?

Tried with my laptop and I can reach it from outside the firewall only (thus not with my desktop that poses problem here)

Offline

#16 2018-04-09 21:09:30

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,076
Website

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

Try changing the server in /etc/systemd/timesyncd.conf to one that you can reach (or open up your firewall).

Offline

#17 2018-04-12 18:05:59

cyrf0006
Member
Registered: 2016-02-05
Posts: 47

Re: [SOLVED] dpkg-reconfigure tzdata leads to wrong time

OK, found the answer. Our network has its own NTP server and all the others are blocked.

So you have to dig for the good server and update /etc/ntp.conf accordingly.

After restarting NTP it should take a couple of minute to get the good time:

sudo systemctl restart ntp

Offline

Board footer

Powered by FluxBB