Wednesday, September 15, 2010

Time Zone Setting - RHEL

There are two steps involved in this operation:
1. Edit the following file for timezone changing and then reboot the server:
:/root#>cat /etc/sysconfig/clock
# The ZONE parameter is only evaluated by system-config-date.
# The timezone of the system is defined by the contents of /etc/localtime.
ZONE="America/Los_Angeles"
UTC=true
ARC=false
root@(WEB-SERVER):/root#>date
Wed Sep 15 06:09:05 PDT 2010
root@(WEB-SERVER):/root#>mv /etc/sysconfig/clock /etc/sysconfig/clock.orig
root@(WEB-SERVER):/root#>cp /etc/sysconfig/clock.orig /etc/sysconfig/clock
root@(WEB-SERVER):/root#>vi /etc/sysconfig/clock
root@(WEB-SERVER):/root#>date
Wed Sep 15 06:11:51 PDT 2010
root@(WEB-SERVER):/root# cat /etc/sysconfig/clock
# The ZONE parameter is only evaluated by system-config-date.
# The timezone of the system is defined by the contents of /etc/localtime.
ZONE="America/New_York"
UTC=true
ARC=false


2. After reboot you do the following [ because the timezone of the system is defined by the contents of /etc/localtime.]
mv /etc/localtime  /etc/localtime-old
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
[ In /usr/share/zoneinfo/ all the zones etc are there. all you need to choose the right zone]

No comments:

Post a Comment