When you install Ubuntu, it asks you to set the time zone. If you choose the wrong time zone, or if you move to some other part of the world, you can easily change it later.

How do I change the time zone in Ubuntu and other Linux distributions

There are two ways to change the time zone in Ubuntu. You can use graphical Settings or the timeDatectl command in the terminal. You can also change the /etc/timezone file directly, but I don’t recommend doing so.

In this beginner’s tutorial, I’ll show you both graphical and terminal methods:

  • Change the time zone in Ubuntu via the GUI (for desktop users)
  • Change the time zone in Ubuntu from the command line (both desktop and server work)

Method 1: Change the Ubuntu time zone on the TERMINAL

Ubuntu or some other distributions that use Systemd can use the timeDatectl command on a Linux terminal to set the time zone.

You can use the timeDatectl command with no arguments to check the current date and time zone Settings:

[email protected]:~$ timedatectl
                      Local time: Sat 2020-01-18 17:39:52 IST
                  Universal time: Sat 2020-01-18 12:09:52 UTC
                        RTC time: Sat 2020-01-18 12:09:52
                       Time zone: Asia/Kolkata (IST, +0530)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
Copy the code

As you can see in the output above, my system uses Asia/Kolkata. It also tells me that it is 5 hours and 30 minutes ahead of universal time.

To set the time zone in Linux, you need to know the exact time zone. You must use the correct format for the time zone (the time zone format is continent/city).

To get the list of timezones, use the list-timezones argument of the timedatectl command:

timedatectl list-timezones
Copy the code

It will show you a large list of available time zones.

You can use the up and down arrows or the PgUp and PgDown keys to move between pages.

You can also grep the output and search for your time zone. For example, if you are looking for time zones in Europe, you can use:

timedatectl list-timezones | grep -i europe
Copy the code

Let’s say you want to set the time zone to Paris. Here, use the time zone values for Europe/Paris:

timedatectl set-timezone Europe/Paris
Copy the code

It does not display any success information, but the time zone changes immediately. You don’t need to reboot or log out.

Remember, while you don’t need to be root and use sudo for commands, your account still needs to have manager permissions to change the time zone.

You can verify the changed time using the date command:

[email protected]:~$ date
Sat Jan 18 13:56:26 CET 2020
Copy the code

Method 2: Change the Ubuntu time zone on the GUI

Press the Super key (Windows key) and search for Settings:

In the left sidebar, scroll down a bit for details:

In the details, you will find “Date and time” in the left sidebar. Here you should turn off the automatic time zone option (if it is already enabled) and then click on time zone:

When you click on the time zone, it opens an interactive map that you can click on to close the window on the geographical location of your choice.

After selecting a new time zone, you don’t have to do anything except turn off the map. There is no need to log out or shut down Ubuntu.

I hope this quick tutorial has helped you change time zones in Ubuntu and other Linux distributions. Let me know if you have any questions or suggestions.


Via: itsfoss.com/change-time…

Written by Abhishek Prakash (Lujun9972

This article is originally compiled by LCTT and released in Linux China