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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityRecently 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?
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.
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
timedatectl
. Use timedatectl set-ntp true
to enable synchronization.
– Freddy
Oct 10 '19 at 17:32
ntp
and ntpdate
, then $ sudo dpkg-reconfigure tzdata
, which enabled NTP in $ datetimectl` output.
– Vasconcelos1914
Oct 10 '19 at 18:47
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.
tzdata
package automatically manages date, time and NTP in Debian 10 "Buster".
– Vasconcelos1914
Oct 10 '19 at 18:49
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
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