How to change the time zone in Debian 10

If you configured your Debian system to automatically obtain the time zone, it synchronizes the system time over the Internet so that your system has the time zone as the closest location. If you want to change the time zone to suit your preferences, Debian offers you two ways to do this; from the command line and through the graphical user interface.

In this article, we will explain how to change the current time zone of a Debian 10-Buster system.

How to check the current time zone

Check the time zone through the command line

Open the “Terminal” application by searching in the Application Launcher as follows:

You can access the Application Launcher via the Super / Windows key on your laptop.

Then enter the following command to view information about your system time and time zone:

$ timedatectl

Check time zone

You can also view this information with the following command:

$ ls -l /etc/localtime

The local time

Check time zone via interface

To view information about the current time zone through the user interface, you need to access the date and time settings. You can do this through the Application Launcher as follows:

date and time

Click on the search result by date and time to open the following settings view:

GNOME Date and Time Settings

ads

How to change the time zone

Change time zone via command line

Open a Terminal and enter the following command to get a list of time zones for a specific zone:

Syntax:

$ timedatectl timezone list | grep -i [zone]

Example:

We will use this command to list all time zones in Europe:

$ timedatectl list-timezones | grep -i europe

Time Zone List

In this example, we will set the time zone Europe / Istanbul. First, let’s disconnect the system time from local time using 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 check the changed settings using one of the following commands:

$ timedatectl

or

$ ls -l /etc/localtime

Local time not set

Check time zone via interface

On the “Date and Time” tab of the “Debian Settings” utility, you first need to unlock the settings in this view. To do this, click the “Unblock” button and provide authentication information, since only an authorized user can change the date and time settings.

Authenticate as administrator

Click the Authentication button. Now you will see the settings as active / custom.

Please disable the automatic time zone button if it is enabled:

Date and Time Settings

Then select the Time Zone option to change the time zone.

select a country

Through the above view, you can either search for the time zone through the search bar, or manually navigate to your time zone with the mouse. Once you do this, the time zone of your system will change.

As you have already seen, it is very simple to change the time zone of your Debian system both through the user interface and from the command line. You just need to follow a simple procedure and use several commands to complete this task.

How to change the time zone in Debian 10

Sidebar