Enter your email address below and subscribe to our newsletter

How to Set Timezone in Debian 11/10

Share your love

The local time for your system is derived from your timezone which is nothing but a geographical area of Earth with the specified time.

Generally, users get the option to choose their timezone while the installation process but somehow you have selected the wrong time zone, you can easily overcome that issue by the given guide on how to set the timezone in Debian 11/10.

Why Timezone is Important for Linux Operating System

There are various reasons why you should have a perfect time zone synced with your Linux system as using the correct timezone is required for many system related tasks and processes and some of them are:

Cron Daemon: In any Linux distro, the is a daemon called cron which heavily relies on the system’s timezone for executing cron jobs.

Timestamps: To audit any process in Linux, we use log files as they store each important task performed over the system. Log files use timestamps which are based on the system’s timezone.

After knowing the importance of timezone, let’s start the process of how to change timezone in Debian 11 which will also apply to other Debian-based distros such as Ubuntu, Linux Mint, Pop_OS, Elementary OS, and many others.

Change Timezone in Debian 11/10

We are going to show you different ways to change timezone in Debian 11 so that you can configure timezone with the most suitable method for your workflow. So let’s start with the easiest method of configuring timezone in Debian 11.

Method 1: Setting Timezone Using GUI

As we previously mentioned, this is the easiest way to set timezone in Debian as it does not involve any complex steps and commands. Just follow the given steps and you will be able to set a timezone in a couple of minutes.

Step 1: Open Settings

As the option to configure timezone is located in settings, we are required to open settings to configure timezone. Click on Activities and type settings. Hit Enter on the first result and it will open settings for us.

1. search for settings in Activities

Step 2: Open Date & Time

Once you open settings, you will get numerous options to choose from. Select “Date & Time” so that we can proceed further on setting the timezone.

1.1 open date and time settings

Step 3: Configure Timezone

To configure the timezone, click on the “Time Zone” option by which we can select the required timezone.

1.2 click on time zone

It will show us the current time. In my case, it is showing Los Angeles as my current time.

1.3 showing current time

To change your existing timezone, search for your country and it will show all the available options. As I want to switch to India, I will search for Kolkata and it will show me available results.

1.4 search for kolkata

Hit Enter on shown result and it will change your timezone with desired option.

1.5 timezone configured to kolkata

Method 2: Change Timezone Using timedatectl Command

This is the easiest way to configure timezone using Terminal as we are using timedatectl is intended to display and configure Time and Date. Follow the given commands to change the timezone.

Step 1: Verify Current Timezone

To display what’s the current timezone, use the following command:

 timedatectl 

2. timedatectl

As you can see, my current timezone is Asia/Kolkata.

Step 2: Check Available Options.

To display all the available options for timezone in Debian 11, use the following command:

 sudo timedatectl list-timezones 

2.1 sudo timedatectl list-timezones

As you can see, there are numerous options. But you can filter them by your country. You can use the Grep command to achieve filtered results. As I want to display the locations only in Asia, I will use the following command:

 sudo timedatectl list-timezones | grep asia 

2.2 sudo timedatectl list-timezones | grep asia

Step 3: Configure Timezone

Once you decide timezone from the list, you can apply it by following the command structure:

 sudo timedatectl set-timezone {Country/Location} 

As I am going to apply the timezone of Dubai, I will use the following command:

 sudo timedatectl set-timezone Asia/Dubai 

2.3 sudo timedatectl set-timezone Dubai

Step 4: Verify Changes

After applying changes, we must cross-check whether we have successfully applied changes or not. We can easily do that by generating the current timezone for our system by the following command:

 timedatectl 

2.4 timedatectl dubai

You can see, that we have successfully changed our timezone from Asia/Kolkata to Asia/Dubai.

Method 3: Change Timezone By Configuring File

In Linux Operating System, the file located at /etc/localtime file contains a link to the current timezone of our system and in this method, we are going to use that for changing timezone in our Debian 11.

Step 1: Verify Current Timezone

This step will generate the current timezone which will be helpful in the end to cross-check whether we have successfully changed our timezone or not. To display the current timezone, use the following command:

 timedatectl 

3. timedatectl Asia

As you can see, my current timezone is Asia/Kolkata.

Step 2: Generate Symbolic Link

As we already know that file located at /etc/localtime contains the details about the current timezone. Now, let’s generate a symbolic link by which we can identify the path of the timezone by the following command:

 ls -l /etc/localtime 

3.1 ls -l localtime

You can see that details about my timezone are situated at /usr/share/zoneinfo and says my current timezone is Asia/Kolkata.

Step 3: Check for Available Options

Once we know the symbolic link, it is time to display available options for our specific country. To display options with a specific country, users are required to follow the given command syntax:

 ls /usr/share/zoneinfo/{Country Name or Continent Name}/ 

As I want to generate options for America, I would use the following command:

 ls /usr/share/zoneinfo/America/ 

3.2 ls america

These are the available options for America. Select your desired option as we are going to change the current timezone in the next step.

Step 4: Change Timezone

To change the existing details about the timezone in the file located at /etc/localtime, users are required to follow the given command syntax:

 sudo ln -sf /usr/share/zoneinfo/{Country Name or Continent Name/{Location} /etc/localtime 

As I want to switch my current timezone to New York, I would use the following command:

 sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime 

3.3 timezone to New York

Step 5: Verify Changes

To verify whether we have successfully changed our timezone or now, we can generate the current timezone by the following command:

 timedatectl 

3.4 timedatectl New York

Similarly, you can also use the following command to show the current timezone.

 ls -l /etc/localtime 

3.5 ls -llocaltime

Frequently asked questions related to Timezone

How do I set the timezone in Debian?

Open your settings and select the “Date & Time” option. From here, you will find an option to change your time zone.

Related Posts:

Conclusion

This was our take on how to change timezone in Debian 11 which is also applicable to other Debian-based distros. We have included multiple ways to set timezone so that you can choose what fits the best to your workflow.

Share your love
Sagar Sharma
Sagar Sharma

Sagar always uses Linux to its core and loves to write the technical side of system administration! While he's not writing for GeniusGeeks, you can find him writing for core linux blogs like IT'SFOSS.com and LinuxHandBook.com

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!