Updating the System Time on a Raspberry Pi

The Raspberry Pi for some reason does not properly update the system time automatically.  To do this, simply install ntpdate.

View your current date and time:

$ date

Install ntpdate:

$ sudo apt-get install ntpdate

To update the time zone, simply 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/America
$ sudo ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

Restart the ntp service:

$ sudo service ntp restart

Check the date again:

$ date

Your Raspberry Pi time should now be set!

References:

Advertisements

2 responses to “Updating the System Time on a Raspberry Pi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s