1

Recently installed Debian 10 "Buster" at an old computer here and now it's showing $ date output with 1 hour less.

How could be sycronized system time with NTP GMT -3, America/Recife timezone?

8

To verify the timezone of your system (mine is Europe/Berlin), run

$ cat /etc/timezone
Europe/Berlin

If it is wrong, run

sudo dpkg-reconfigure tzdata

and choose America, then Recife and check if the printed local time is now correct.

You can also print the UTC date with

date -u

which should be your local time +3 hours.

  • Is this tzdata synchronized with some sort of online clock or just with hardware clock? Looks like it doesn't works alongside with NTP. – Vasconcelos1914 Oct 10 '19 at 15:50
  • The synchronization is usually done by systemd-timesyncd or ntpd or manually. The timezone itself is just static information. You can show the status of your system clock (RTC stores local time or universal time) and status of systemd-timesyncd.service with timedatectl. Use timedatectl set-ntp true to enable synchronization. – Freddy Oct 10 '19 at 17:32
  • The timedatectl set-ntp true isn't working. – Vasconcelos1914 Oct 10 '19 at 18:27
  • 1
    Had to remove ntp and ntpdate, then $ sudo dpkg-reconfigure tzdata, which enabled NTP in $ datetimectl` output. – Vasconcelos1914 Oct 10 '19 at 18:47
4

If the time difference is exactly one hour, it's most likely not a time issue, but a time zone issue.

Maybe you don't need ntp, you just need to set the right time zone.

This answer might help.

  • The tzdata package automatically manages date, time and NTP in Debian 10 "Buster". – Vasconcelos1914 Oct 10 '19 at 18:49
4

You should be able to do so using ntp or ntpdate.

apt install ntpdate
ntpdate pool.ntp.org

ntpdate is mostly useful for one-time synchronizations. Whereas the ntp daemon would run in background, and keep your clock up to date:

apt install ntp
cat <<EOF >/etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
server pool.ntp.org
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
EOF
systemctl start ntp
systemctl enable ntp

Though you might just be using the wrong timezone. Some GMT-3 example:

ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires /etc/localtime
  • 1
    Tried it, but conflicted with tzdata, which is the default package that manages date and time in Debian 10 "Buster". Solved it justly removing ntp and ntpdate, then $ sudo dpkg reconfigure tzdata, which enabled NET service in $ timedatectl output. And yes, tzdata is online synchronized with NTP. – Vasconcelos1914 Oct 10 '19 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.