In this article, we will explain how to change the current time zone of a Ubuntu 18.04 LTS system.
How to Check the Current Time Zone
Through the Command Line
Open your Terminal application through Ubuntu Dash or through the Ctrl+Alt+T shortcut. Enter the following command in order to view information about your system's time and time zone:
$ timedatectl
You can also view this information by using the following command:
$ ls -l /etc/localtime
Through the UI
In order to view information about the current time zone through the UI, you need to access the Date & Time settings in the Settings utility. You can do so through the system Dash as follows:
Click on the Date & Time search result to open the following Settings view:
How to Change the Time Zone
Through the Command Line
Open the Terminal and enter the following command in order to list all the timezones of the specified zone:
Syntax:
$ timedatectl list-timezones | grep -i [zone]
Example:
We will use this command to list all the time zones of Europe:
$ timedatectl list-timezones | grep -i europe
In this example, we will be setting the time zone to Europe/Istanbul. First, let us unlink the system time with local time through the following command:
$ sudo unlink /etc/localtime
The next step is to use the following command to set a new time zone:
Syntax:
sudo ln -s /usr/share/zoneinfo/[Zone/TimeZone] /etc/localtime
Example:
sudo ln -s /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
You can then verify the changed settings through one of the following commands:
$ timedatectl
or
$ ls -l /etc/localtime
Through the UI
In the Date & Time settings in the Ubuntu Settings utility, switch off the Automatic Time zone button if it is turned on:
Then click the Date & Time option in order to change the time zone.
Through this view, you can either search for a time zone through the search bar or manually move to your time zone through the mouse. As soon as you do that, the time zone of your system will be changed.
As you have seen, it is very simple to change the Time Zone of your Ubuntu system both through the UI and the command line. You just need to follow a simple procedure and use a few commands in order to perform this task.
No comments:
Post a Comment