The raspberry pi does not have the hardware to keep track of the date and time when it is turned off. It therefore tries to get the time from the network whenever it boots. I'm guessing you don't have an internet connection when the pi starts back in april.....
You could have bought a PC for about 1000 euros. but you bought a raspberry pi for 40. There are some compromises.
I haven't run into this problem for ages: Apparently the assumption: "you often have an internet connection" works for me.
Here is an example of the date command which can be used to set the time/date if the Raspberry Pi is not connected to the internet:
#sudo date --set='TZ="America/Chicago" 8 Oct 2017 14:32'
Note that the use of the "nornal" backward ticks after --set= and at the end of the command are required to keep the shell (bash) from
misinterpreting special characters in the command line.
The time zone (TZ=) will have to be set according to where you are of course and the time is in 24 hour format.
My Raspberry Pi is connected to internet via wifi. Even after setting the proper timezone and country, I does not update the time and date.
Maybe your router settings do not like Network Time Protocol (ntp).
To disable ntp and manually update the time instead:
'sudo update-services ntpd disable'
'sudo apt-get install ntpdate'.
Then you can update the date and time manually with
or you can specify a timeserver like
'sudo ntpdate pool.ntp.org'
To set the time at boot, add 'ntpdate' to rc.local.
If you want automatic updates, you could add 'ntpdate' as a cron job.
As far as I know, the raspberry already does the equivalent of
sudo ntpdate pool.ntp.org
at boot. That's the "sets the time from the network".
I would suggest that instead of manually entering the time, you try this sudo ntpdate command manually first to see if it works for you. Only when it works is it useful to invest time in making such changes permanent (i.e. happen automatically on the next boot).
Is the Raspbian ntp package installed?
Check: dpkg -l ntp
You should see something like this as output:
ii ntp 1:4.2.8p10+d amd64 Network Time Protocol daemon
If not, do this:
sudo apt -y install ntp
That will get you network time automatically. No manual intervention required.
Raspberry Pi doesn't have an RTC ( Real time clock) built in to the board due to multiple reasons. Instead they update the time through network using NTP (Network Time Protocol ). But in your case if Pi is not connected to internet then it is not possible for RPi to update the date and time after the reboot.
Linux Kernel supports RTCs through SPI and I2C buses. So one option for you is to add an external RTC with a battery Attached. RTCs needs to be powered to keep the time and date upto date ( Generally using a dedicated button cell 2032).
For example you can use DS1307 based solution.
Please take a look this blog post on adding RTC to Rpi.
You can buy it from here:
Hope this helps.
I have purchased a Raspberry Pi 3 model B in August 2017. I am unable to set up Date and Time. Every time I turn on the hardware, It shows date - 12 April 2017.
I have tried setting it up with Sudo raspi-config but could not do it.
Please guide me on the procedure.