In this article, we cover how to check the time zone in Ubuntu through a terminal. We love to travel. And, past few months travel demand has been strong. Most of us have been traveling across continents. We can easily forget the time zone we have set on our devices.
So, it is better to check the time zone if our devices don’t show the right time.
Two methods we cover here that can help us get time zone in Ubuntu:
- /etc/timezone file and,
- timedatectl command-line tool.
How to check the time zone in Ubuntu through terminal?
Method I. Use the cat command-line utility to read the contents of the file: /etc/timezone
cat /etc/timezone
The output would be different for everyone depending on the place they stay.
Method II. Through command-line utility, timedatectl:
timedatectl status | grep -i "time zone"
In conclusion, we have covered here how to check the time zone in Ubuntu through terminal.
Additional Info:
It is important to change the time zone if it doesn’t represent our current location. There are again numerous ways to get that done. We use tzdata package (contains time zone data).
Note: Following operations require Administrative Rights. If you don’t have the required rights then, contact your System Administrator.
If the package isn’t installed, then update the repository first:
sudo apt update
Then, to install tzdata in Ubuntu:
sudo apt install tzdata
Now, to change the time zone in Ubuntu:
sudo dpkg-reconfigure tzdata
Select the geographic area and location. When it’s done, it would return back to the terminal screen to show the current Local and Universal time.