Thursday, April 25, 2013
Time zones are the last thing a systems administrator wants to deal with. NTP usually takes care of most time related tasks, but sometimes you just need to set things manually.
All time zones available on your RHEL system can be found in /usr/share/zoneinfo. Change to that directory, and browse through the directory structure to find the particular time zone you need.
With your favorite text editor, open /etc/sysconfig/clock and change ZONE= to the particular time zone you need.
For example, to set your system to the Pacific Time Zone, set ZONE= to the following:
The syntax follows the directory structure in /usr/share/zoneinfo. America/Los_Angeles is located at absolute path /usr/share/zoneinfo/America/Los_Angeles.
Once you have edited /etc/sysconfig/clock, create symlink localtime that points to the particular time zone file:
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
Finally, for the changes to take effect, restart any applications that use the time zone setting in /etc/sysconfig/clock, or simply restart the system to ensure every application is aware of the change.