Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to Change Timezone on CentOS/RHEL 8/7/6

    How to Change Timezone on CentOS/RHEL 8/7/6

    RahulBy RahulJanuary 2, 20152 Mins ReadUpdated:October 14, 2019

    Sometimes we forgot to set timezone properly for newly installed systems or sometimes we need to change the timezone of systems for various testing etc. Under CentOS/RHEL systems all timezone settings file are located under /usr/share/zoneinfo/ directory and /etc/localtime is the file use is used by operating system to set current timezone for system. So the best way to change the time zone of the server is to link /etc/localtime file to correct configuration file under /usr/share/zoneinfo/ files.

    First check current timezone used by your system using date command.

    [[email protected] ~]# date
    
    Mon Oct 14 11:04:38 EST 2019
    

    As per the above example, our system timezone is set to EST.

    Change TimeZone in CentOS/RHEL 8/7

    In CentOS/RHEL 7 we use timedatectl command to change current timezone of system. First use following command to list all timezones

    timedatectl list-timezones
    

    Now use following command to change timezone to America/Los_Angeles.

    timedatectl set-timezone America/Los_Angeles
    

    Change TimeZone in CentOS/RHEL 6/5

    To change timezone on CentOS/RHEL 6/5 we can simply link /etc/localtime file with correct timezone configuration file. For example we are setting America/Los_Angeles as our local system timezone.

    mv /etc/localtime /root/localtime.old
    ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
    

    Your timezone has been changed successfully. Let’s check the timezone again.

    [[email protected] ~]# date
    
    Mon Oct 14 04:05:08 PDT 2019
    
    date localtime time timezone
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Add RPMForge Yum Repository in CentOS/RHEL 7/6/5
    Next Article How to Improve Power Management in Ubuntu using TLP

    Related Posts

    (Resolved) userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms

    Updated:May 10, 20221 Min Read

    How to Install Apache ActiveMQ on Ubuntu 22.04

    3 Mins Read

    How To Enable SSH Server on Ubuntu 22.04

    Updated:April 22, 20222 Mins Read

    How to Change TimeZone in Azure App Service

    Updated:April 16, 20223 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    10 Best Linux Video Players in 2022

    Updated:February 18, 20226 Mins Read

    5 Comments

    1. James M on May 22, 2019 5:15 pm

      Wonderful. I have been looking for this. Too many variations of Linux. Hard to find the commands sometimes.

      Thanks for sharing

      Site added to my list 🙂

      Reply
    2. Larry Ellison on October 27, 2017 4:17 pm

      Dude!!! You are man! Full of balls !

      Reply
    3. vikas sharma on August 28, 2017 1:26 pm

      Hi i have two question
      1. i want to update my server time without NTP
      2. i want to delete specifics files from the server
      for eg :- in my system files from 1 march 2017, i want to delete files only specific period of time,means
      i want my files from date 04.06.2017 till today.but won’t delets files that is store or are older than
      03.06.2017.

      Reply
    4. Hari on July 29, 2017 3:37 pm

      Yes, this worked. Many thanks!

      Reply
    5. Isaac on May 23, 2017 1:06 pm

      Thank You, Sir!

      To check if you have RHEL 6 or 7 to use the awesome timedatectl command you can execute uname – r.
      Else the primitive way is also ok with more than a single step.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.