The Raspberry Pi doesn't have a real time clock (RTC) so when your Raspberry Pi loses power, the time isn't kept accurate. You can buy a real time clock for the Pi ot you can run a time server on the Pi to keep the time on the Raspberry Pi accurate. Luckily, this only takes a few minutes to set up and you'll be keeping pifect time :)

Right, enough of the Raspberry Pi time jokes, lets get started... First type in date to see the current time:

date

Next, install ntpdate:

sudo apt get install ntpdate

Now remove the current local time file and make a new symbolic link to your timezone file:

sudo rm /etc/localtime

ls /usr/share/zoneinfo

ls /usr/share/zoneinfo/Europe

sudo ln -s /usr/share/zoneinfo/Europe/London /etc/localtime

Finally, restart the ntp service:

sudo service ntp restart

Your date should now be up to date. You can check this by typing:

date


Comments

comments powered by Disqus
Gary Hall Gary Hall is based in East Yorkshire, England, and has a background in education, marketing and technology. This site is a collection of ideas and resources on these topics.