Keeping track of time is essential for any device. Here’s how you can check the current time on your Raspberry Pi.
Learning how to check the time on your Raspberry Pi can be helpful in a variety of situations, from troubleshooting issues to scheduling tasks. In this article, we will show you how to check the time …
Updated September 20, 2023
Learning how to check the time on your Raspberry Pi can be helpful in a variety of situations, from troubleshooting issues to scheduling tasks. In this article, we will show you how to check the time on your Raspberry Pi using both command line and graphical methods.
There are multiple ways to check the time on your Raspberry Pi. Here are two common methods:
- Command Line Method Open a terminal window by clicking on the Terminal icon in the Menu > Accessories or by pressing Ctrl+Alt+T. Type the following command and press Enter:
date
This will display the current date and time on your Raspberry Pi in the format “Weekday Month Day Hour:Minute:Second Year Timezone”. For example:
Thu Aug 6 10:35:27 BST 2020
- Graphical Method Alternatively, you can check the time using the graphical user interface (GUI) of your Raspberry Pi. Click on the clock icon in the top right corner of the screen to display the current date and time:
To set the time manually, click on the clock icon and select “Preferences” > “Date & Time”. Adjust the date and time as needed:
Note that your Raspberry Pi will automatically synchronize its clock with an internet time server if it has access to the internet. If you don’t have a network connection or want to manually set the time, you can do so by following these steps:
- Open a terminal window and enter the following command to edit the system clock configuration file:
sudo nano /etc/systemd/timesyncd.conf
- Find the line that starts with “NTP=” and add your preferred NTP server(s) separated by spaces. For example:
NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
Save the file and exit the text editor (Ctrl+X, Y, Enter).
- Restart the systemd-timesyncd service to apply the changes:
sudo systemctl restart systemd-timesyncd
Your Raspberry Pi will now synchronize its clock with the specified NTP servers. You can check the status of the time synchronization by running the following command:
timedatectl status