Tuesday, June 22, 2010

Change TimeZone in your Linux Server quickly

SkyHi @ Tuesday, June 22, 2010
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 pool.ntp.org

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 pool.ntp.org

# /etc/init.d/ntpd start



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

# tzconfig


REFERENCES
http://linuxadminzone.com/change-timezone-in-your-linux-server-quickly/



 

Change timezone on CentOS

Here’s how to change the timezone on CentOS/RHEL;
cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime

REFERENCES
http://blog.connexeon.com/sysadmin/linux/change-timezone-on-centos/




Centos – how to setup timezone

 

Step 1: Basically
ln -s /usr/share/zoneinfo/UTC /etc/localtime
date
Tue Nov 9 10:54:12 CET 2010 (this is wrong!!)
Step 2: So,
yum install ntp
chkconfig ntp on
ntpdate pool.ntp.org
service ntpd start
date
Tue Nov 9 09:58:16 CET 2010
Step 1: Basically
ln -s /usr/share/zoneinfo/UTC /etc/localtime
date
Tue Nov 9 10:54:12 CET 2010 (this is wrong!!)
Step 2: So,
yum install ntp
chkconfig ntp on
ntpdate pool.ntp.org
service ntpd start
date
Tue Nov 9 09:58:16 CET 2010

REFERENCES
http://shamuntoha.wordpress.com/2010/11/09/centos-how-to-setup-timezone/