Change TimeZone in your Linux Server quickly:

by jagbir on November 10, 2008

In any Red Hat based (RHEL/CentOS/Fedora) Server, change time zone to PST/PDT quickly:

# mv /etc/localtime /etc/localtime.old && ln -s /usr/share/zoneinfo/PST8PDT /etc/localtime

or set zone to IST:
# mv /etc/localtime /etc/localtime.old && ln -s /usr/share/zoneinfo/Calcutta /etc/localtime

or Set the TZ environment variable for quick display time according to preferred Time Zone:
# export TZ=America/Los_Angeles
and then view the output of date command.

or If you have the utility rdate, update the current system time by executing
# rdate -s

or You can execute ‘system-config-date’ for setting up date/time and time zone:
# system-config-date

or better install ntp to sync date/time automatically from time server:
# yum install ntp
# chkconfig ntpd on
# ntpdate
# /etc/init.d/ntpd start

If you’re using Ubuntu, tzconfig is there for you:
# tzconfig

  • Dime

    can ntp cahnge timezone to the old one, if I
    1) start ntpd
    2) change timezone via ln -s /usr/share/zoneinfo/ /etc/localtime

  • jagbir

    @ Dime..
    ntp will only sync time from the time server, ur time zone should remain same.

  • cms application

    hi…i found your website through search engine, thanks for information about Change Time Zone in your Linux Server quickly…its really nic

Previous post:

Next post: