Raspberry Pi Pico Tips and Tricks

Wednesday 21 January 2015

Changing the default local time on a Raspberry Pi

The following post is a section of the book 'Raspberry Pi: Measure, Record, Explore'.  The entire book can be downloaded in pdf format for free from Leanpub or you can read it online here.
Since this post is a snapshot in time. I recommend that you download a copy of the book which is updated frequently to improve and expand the content.

Changing the default local time

By default Raspbian is configured to use UTC as its local time. This can be reconfigured by executing the following command from the terminal;
sudo dpkg-reconfigure tzdata
You will be asked to pick the continent or ocean of the time zone you are in and then the specific country.
Once your selection is complete, reboot to allow the changes to take effect;
sudo reboot
Then we can check what time the Raspberry Pi thinks it is with the date command;
The response should be something like;
Sun Dec 28 16:47:16 NZDT 2014
(if you have set your local time to be New Zealand time (who wouldn’t?)).

The post above (and heaps of other stuff) is in the book 'Raspberry Pi: Measure, Record, Explore' that can be downloaded for free (or donate if you really want to :-)).

No comments:

Post a Comment