In this article we will give detailed procedures, how to set time zone on your Debian 11(Linux OS) as mentioned below:
- How to set Time Zone Using Graphical User Interface
- How to set Time Zone Using “timedatectl” command
- How to set Time Zone by configuring /etc/localtime file
So if you are a Debian user and want to set your Time Zone then follow any of the procedures explained below.
How to Set Time Zone Using Graphical User Interface
Step1: Open Settings
Firstly you need to open the setting by typing “settings” in the search bar of activities and clicking on Settings icon as shown below:
Settings window will be opened:
Step 2: Open “Date and Time” settings
Now from list of settings on the right side click on “Date & Time” and setting will open on right side and click on Time Zone on right side as shown below:
Step 3: Set Time Zone
After clicking on “Time Zone”, a new window will appear in the search tab and write the name of the region whose time zone you want to set.
My current time zone is New York, United States and I will change it to Toronto, Canada as shown below:
Now after choosing my time zone, new time zone will be shown:
How to Set Time Zone Using “timedatectl” command
The “timedatectl” is a one of the commands of the Linux system used to display and adjust the date and time of the system. It is available on all contemporary Linux platforms.
In the below steps we will use the “timedatectl” command to change time on the Debian system.
Step 1: Check Current Time Zone
You can check for current Time Zone using date command on terminal as mentioned below:
Step 2: Display all time zones
Now check for all time zones available on Debian 11 by below mentioned command on terminal:
This will display all Time Zone regions and you can choose any of the regions from the list shown above.
You can also check for your region for availability by giving the name of city or country as I can check for Time Zones available for “Africa”:
Step 3: Set Time Zone
Now you can set the Time Zone suitable for your location from available Time Zones, I am setting Time Zone of Africa/Cairo by below mentioned command:
Step 4: Verification
Check current Time Zone to verify that whether the changes are applied or not by below mentioned command:
EET stands for Eastern European Time.
How to set Time Zone by configuring /etc/localtime File
The /etc/localtime file contains the link to the current Time Zone file. It can be used to change the Time Zone in every version of Debian.
Step1: Check current Time Zone
You can check for current Time Zone using timedatectl command on terminal as mentioned below:
EET (East European Time) is my Time Zone region.
Step 2: Check for symbolic link
As /etc/localtime contains the current time zone file. Now check for symbolic link to check details of Time Zone by below mentioned command:
The /usr/share/zoneinfo files tell about my Time Zone region “Africa/Cairo”.
Step 3: Check available Time Zone for Specific Country
Using /usr/share/zoneinfo file you can check for available Time zones for specific region, like if you want to set American region as your new Time Zone then you can check the available Time Zones for “America” by below mentioned command:
Above output shows all the available Time Zone regions for America.
Step 4: Set Time Zone
You can set the Time Zone by associating either the city or zone with the “/etc/localtime” file. In the below mentioned command I am setting “America/New_York” as my Time Zone region, you can set any of the available Time Zone according to your requirement:
Step 5: Verification
Use date command to verify that your Time Zone region is changed:
Or you can check your Time Zone info by “/etc/localtime” as we did above:
Setting the correct Time Zone on your System is important for some functionality, as it can be used for log timestamps. It is set during installation of the Debian system but you can reset it using GUI and CLI. In this article we have discussed three approaches to set TimeZone on Debian 11, Using Graphical User Interface, using “timedatectl” command on terminal and using “/etc/localtime” file on terminal. If you are a Debian (Linux OS) user and want to set your Time Zone according to your requirements then this Article will surely help you.