This article will show you how to configure the date and time on Raspberry Pi easily from the terminal.
2 Easy Ways to Configure Date and Time on Raspberry Pi Terminal
There are two most straightforward methods to configure the date and time on Raspberry Pi system, which are:
Let’s discuss these two methods in detail to configure date and time on Raspberry Pi.
Method 1: Configure Date and Time Through Raspberry Pi Configuration
The Raspberry Pi configuration tool allows users to configure various system settings from the terminal. Since date and time are part of the Raspberry Pi system, you can set them by opening the Raspberry Pi configuration through the following command:
Within the Raspberry Pi configuration, you will see several options but you will find the date and time option in the “Localisation Options” section.
Go to the “Timezone” option in the “Localisation Options”.
Select the geographic area you are currently living in. In my case, it’s “America”.
Select the city or region where you are living. In my case, it’s “Santiago”.
The above steps will successfully configure the date and time on your Raspberry Pi system.
Method 2: Configure Date and Time Through tzdata
The tzdata is a Linux package that contains data files with various time zone options. You can use this package to configure the date and time on your Raspberry Pi system. To use this package for date and time configuration, run the following command:
This will open the same time zone configuration you already did in Method 1.
Follow the same method to configure the date and time on your Raspberry Pi system.
Both methods use the tzdata package to configure the date and time on the Raspberry Pi system. You can pick any method to synchronize your system clock according to your time zone.
Conclusion
Configuring the date and time on the Raspberry Pi system is helpful for multiple purposes, especially when you are working on some web servers, which need the exact date and time of the system. You can configure the date and time on the Raspberry Pi system either from Raspberry Pi configuration using the “raspi-config” command or using tzdata. Both methods quickly configure the date and time on your Raspberry Pi system.