How can I change timezone in centos?



Change time zone in centos linux dedicated server is very easy.Login to server using ssh client

    

CentOS timezone config files and directories path


/usr/share/zoneinfo/ – The system timezone directory contains the files as per timezone name. For example, the file /usr/share/zoneinfo/America/New_York represents time zone for New York.

/etc/localtime – It is a symlink to the file localtime or to the correct timezone file in the system located in /usr/share/zoneinfo/ directory.
    

Current timezone detail

    Type the date command or the ls command:
    $ date
    $ ls -l /etc/localtime
    

Change timezone in CentOS 7


        To find list of all available time zones, run:
        # timedatectl list-timezones
        ##*** Grep possible Asian timezones ***##
        # timedatectl list-timezones | grep America
        
            America/Adak
            America/Anchorage
            America/Anguilla
            America/Antigua
            America/Araguaina
            America/Argentina/Buenos_Aires
            America/Argentina/Catamarca
            America/Argentina/Cordoba
            America/Argentina/Jujuy
            America/Argentina/La_Rioja
            America/Argentina/Mendoza
            America/Argentina/Rio_Gallegos
            America/Argentina/Salta
            America/Argentina/San_Juan
            America/Argentina/San_Luis
            America/Argentina/Tucuman
            America/Argentina/Ushuaia
            America/Aruba
        
            .....

        # timedatectl set-timezone time_zone_name

        We are going to set timezone to  America/Mexico_City
        timedatectl set-timezone America/Mexico_City

        Then verify using
            # date
            # ls -l /etc/localtime  
                

Change time zone in centos 6

Type the following commands as root user :

cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

Verify new settings by typing the following two commands:

date
ls -l /etc/localtime

Get the best Website Hosting offers here-