Friday, June 6, 2008

Changing Time Zone CL style

Set system time RHEL 5. Probably works for RHEL3 and 4 but not tested. The time zone files are listed in /usr/share/zoneinfo. Simply, cd to /etc directory and create a symbolic link to change the time of the system. Make sure you are pointing to the correct time zone.

cd /etc
ln -sf /usr/share/zoneinfo/Americas/Los_Angeles localtime

Note using the date command will not overwrite this setting. Using date -s hour:min and then running date again, the time is not changed.

In addition to make sure the system time comes up correct again, you can edit /etc/sysconfig/clock and make sure tha appropriate time zone is listed.

Note: the /etc/localtime take precidense over the /etc/sysconfig/clock file.

No comments: