Newsletter Subscribe
Enter your email address below and subscribe to our newsletter
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.
Table of Contents
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.
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.
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.
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.
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.
To configure the timezone, click on the “Time Zone” option by which we can select the required timezone.
It will show us the current time. In my case, it is showing Los Angeles as my 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.
Hit Enter on shown result and it will change your timezone with desired option.
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.
To display what’s the current timezone, use the following command:
timedatectlAs you can see, my current timezone is Asia/Kolkata.
To display all the available options for timezone in Debian 11, use the following command:
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
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
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
You can see, that we have successfully changed our timezone from Asia/Kolkata to Asia/Dubai.
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.
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
As you can see, my current timezone is Asia/Kolkata.
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
You can see that details about my timezone are situated at /usr/share/zoneinfo and says my current timezone is Asia/Kolkata.
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/
These are the available options for America. Select your desired option as we are going to change the current timezone in the next step.
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
To verify whether we have successfully changed our timezone or now, we can generate the current timezone by the following command:
timedatectl
Similarly, you can also use the following command to show the current timezone.
ls -l /etc/localtime
Open your settings and select the “Date & Time” option. From here, you will find an option to change your time zone.
Related Posts:
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.