A
A
Alexander2015-01-01 15:13:21
NTP
Alexander, 2015-01-01 15:13:21

How to set time and date on Raspberry PI automatically when turned on from NTP server?

How to set time and date on Raspberry PI automatically when turned on from NTP server? I tried to do as described here - roberthanson1.wordpress.com/2013/03/23/day-5-getti...
Installed servers in ntp.conf in ru.pool.ntp.org - did not help, the date is still incorrect .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Grims, 2017-02-15
@grims

The raspberry pi does not have a hardware clock:

[email protected]:~ $ sudo hwclock 
hwclock: Cannot access the Hardware Clock via any known method.

Therefore, we go the other way:
[email protected]:~ $ date
Wed 15 Feb 08:00:59 UTC 2017

[email protected]:~ $ sudo dpkg-reconfigure tzdata 
Current default time zone: 'Europe/Moscow'
Local time is now:      Wed Feb 15 11:15:58 MSK 2017.
Universal Time is now:  Wed Feb 15 08:15:58 UTC 2017.

[email protected]:~ $ date 
Wed 15 Feb 11:16:08 MSK 2017

[email protected]:~ $ sudo ntpdate -u ntp.ubuntu.com
15 Feb 11:16:39 ntpdate[7529]: adjust time server 91.189.94.4 offset -0.001106 sec

[email protected]:~ $ date 
Wed 15 Feb 11:16:49 MSK 2017

*May require "ntpdate" to be installed (aptitude install ntpdate).
It is possible without it, check the existence of the /etc/ntp.conf file
[email protected]:~ $ sudo /etc/init.d/ntp restart
[email protected]:~ $ sudo ntpd -gq

From the raspberrypi forum to the topic NTP / time settings
PS It is quite correct to recommend using sudo raspi-config in the menu, select Localization Options-->Change Timezone-->...
Or if you are a geek, you can also work with your hands poke and poke .

L
ldv, 2015-01-01
@ldvldv

The link in the comments says that if the date differs by more than 1000 seconds, the time will not be synchronized automatically. Maybe your case?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question