• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Set or Change Timezone on Debian 11

Written by Admin, Updated On January 6, 2023
debian, terminal, timezone
How to Set or Change Timezone on Debian 11

Sometimes you need to change timezone due to nature of working or any other reason. You can set the Debian system’s timezone at the time of installation as well as you can change it later easily. This guide explains how to set or change timezone on Debian 11 system.

Check Current Timezone#

Generally, timedatectl command-line utility is same for all Linux distributions and used to get and set system’s timezone easily. Execute the below command to get current timezone:

timedatectl

It should display output as below:

               Local time: Fri 2022-11-12 03:00:45 UTC
           Universal time: Fri 2022-11-12 03:00:45 UTC
                 RTC time: Fri 2022-11-12 03:00:45
                Time zone: UTC (UTC, +0000)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

The /etc/localtime is a link to the original timezone file. You can check the symbolic link using the following command:

ls -l /etc/localtime
lrwxrwxrwx 1 root root 12 November 21 03:47 /etc/localtime -> /usr/share/zoneinfo/UTC

Timezone Config Files of Debian#

  • /usr/share/zoneinfo/ – Timezone name wise files are stored in this directory. For example, the file /usr/share/zoneinfo/America/New_York represents time zone for New York.
  • /etc/localtime – This is a symlink to the file localtime located in /usr/share/zoneinfo/ directory.

Change Timezone in Debian#

At first, you should know long name for timezone for which you want to set. To get the list of all available timezones run below command:

timedatectl list-timezones

It will show output like below:

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
...
...
America/Caracas
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Costa_Rica
...
...
Pacific/Saipan
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Wake
Pacific/Wallis
UTC

Choose long name of timezone for your location, run the following command as root or user with sudo privileges.

The syntax for command is:

sudo timedatectl set-timezone NEW_TIME_ZONE

For example, to change timezone to America/New_York run command as below:

sudo timedatectl set-timezone America/New_York

Now, verify timezone again using timedatectl command:

timedatectl

It should changed with new timezone America/New_York.

               Local time: sat 2022-11-12 04:21:50 UTC
           Universal time: sat 2022-11-12 09:16:38 UTC
                 RTC time: sat 2022-11-12 09:16:38
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

Change Timezone By Symlink#

You can alternatively change the timezone by creating a symlink. This method is useful when your server is running older version of Debian or not have timedatectl command is available. We are going to change the timezone by creating symlink /etc/localtime to the timezone in the /usr/share/zoneinfo directory.

Determine timezone, which you want to set and create a symlink, type:

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

To verify changes, list the /etc/localtime file or run the date command:

date
Saturday November 12 04:30:20 EDT 2022

It should show new changed date and time with new timezone.

Conclusion#

Finally, you have learned how to change timezone in Debian 11.

Feel free to leave comment if you have any questions.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install Chromium Web Browser on Ubuntu 22.04
Next Article   How to Install Docker on Ubuntu 22.04

Related Posts

  • How to Install WordPress with Nginx on Debian 11

    How to Install WordPress with Nginx on Debian 11

    March 22, 2023
  • How to Install and Use Docker on Debian 11

    How to Install and Use Docker on Debian 11

    March 10, 2023
  • How to Install MariaDB on Debian 11 Bullseye

    How to Install MariaDB on Debian 11 Bullseye

    March 8, 2023

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
  • How to Install MariaDB on Debian 11 Bullseye
    How to Install MariaDB on Debian 11 Bullseye March 8, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook