How to Set the Time and TimeZone on the Raspberry Pi
I recently installed a fresh install of Raspbian on my Raspberry Pi 3 and when I was setting up my server I noticed that the time was not set correctly. I never have had this issue using Raspbian since it would automatically update the time and grab the current time from the internet. It was frustrating because the project I was working on needed the current current time as well as the timezone.
We will be setting the correct time with the Raspi-Config tool. The Raspi-Config tool is a tool that comes packaged with Raspbian which allows you to configure many options on your Raspberry Pi like overclocking, enabling/disabling Bluetooth as well as setting the correct timezone and grabbing the correct time from the internet.
To set the correct time on the Raspberry Pi and grab the correct time and timezone from the internet
You will need the following:
- Raspberry Pi
- 8GB Micro SD Card (You can use a bigger SD Card to store more videos on your server)
- 2.5A Power Supply
You can either open up a new terminal window if you are running a GUI version of Raspbian or you can SSH into your Raspberry Pi if you are running it headless. I was running Raspbian Stretch when I wrote this tutorial.
Open a new terminal window or connect to your Raspberry Pi over SSH and run the following command to get the current time on your Raspberry Pi:
Run the following command to open up Raspi-Config tools. This will allow us to make changes to our Raspberry Pi configuration:
Now navigate to 4. Localization Options and hit enter
Now select I2 Change Time Zone. You can now set your Time Zone which will automatically update the time as well if you are connected to the internet.