• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Change Time Zone in Linux

Written by Rahul, Updated on December 12, 2020

A time zone refers to the local time of a region or a country. Generally each country uses one time zone but few of the countries shares multiple time zones due to its geological areas.

It is always an important thing to set a correct time zone in your system. Many of applications are build with time crucial. So it is necessary to set correct time zone to work application correctly.

This tutorial will help you to check current time zone of system and also set the new time zone on Linux based systems.

Check Current Timezone

You can view the current time zone of a system by simply typing the ‘date’ command in terminal.

date 

Sat Dec 12 18:19:02 UTC 2020 

The above command shows that this system is running in UTC timezone.

You can also refer to the timedatectl command to view the details output of the current system time, timezone and many other details.

timedatectl 

      Local time: Sat 2020-12-12 18:18:34 UTC
  Universal time: Sat 2020-12-12 18:18:34 UTC
        RTC time: Sat 2020-12-12 18:18:33
       Time zone: Etc/UTC (UTC, +0000)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no 

Change Time zone on Linux System

The Linux keeps time zone relegated files are available under /usr/share/zoneinfo directory. There you can find all the available time zone.

You can choose one of the below methods to change Linux system time zone via command line.

  • Option 1 – Using timedatectl

    Use of timedatectl command is the proffered way to set or change time zone on a Linux system. First find all the available timezones on your system.

    timedatectl list-timezones 
    

    Search for the required time zone in above command. Next use following command to set new time zone on your system.

    sudo timedatectl set-timezone "America/Los_Angeles" 
    
  • Option 2 – Using /etc/localtime

    You can also change the system time by changing the symbolic link of /etc/localtime file on Linux systems. You just need to search for the correct time zone files under /usr/share/zoneinfo directory.

    First rename of remove the current file:

    mv /etc/localtime /etc/localtime-backup 
    

    Then change the symbolic link of file to the correct time zone configuration file:

    ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime 
    
  • The system will automatically adjust the new time based on new time zone set on system. You can again run “timedatectl” command to confirm time zone is updated correctly.

Conclusion

In this tutorial you have learned about to set or change the correct time zone on your Linux system.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy