How to change TIMEZONE in RedHat using command line .

To change timezone we will need to modify /etc/sysconfig/clock file:

# 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=”Europe/Warsaw”
UTC=true
ARC=false

We need to change ZONE parameter to one from /usr/share/zoneinfo folder.  In example:

ZONE=”GMT0″

or

ZONE=”US/Alaska”

The UTC parameter should follow BIOS settings for it. If it’s “true” in BIOS you should set it as “true” in /etc/sysconfig/clock file.

After saving changes to clock file we need to reboot server.

# init 6

For the time on the server to reflect the change we need to link zoneinfo file to /etc/localtime:


# ln -sf /usr/share/zoneinfo/GMT0 /etc/localtime

or:

# ln -sf /usr/share/zoneinfo/US/Alaska /etc/localtime

We can check if change is working:

# date

Tue Sep 28 10:44:07 GMT 2010

One Response to “How to change TIMEZONE in RedHat using command line .”

  1. henry says:

    Thanks a lot!!!

Leave a Response