Change the timezone on CentOSChange the timezone on CentOS

Posted September 14th, 2011 in Linux/Unix/BSD and Quick Tips

I recently needed to set up a CentOS 5 box and completely forgot how to set the timezone. There's apparantly a nice easy text GUI for doing it in RHEL but I couldn't find the same thing on the CentOS box so here's how to do it. It should also work for most Linux systems.

Set the timezone on CentOS

The timezone files are located at /usr/share/zoneinfo and you simply need to create a symbolic link from /etc/localtime to point to the correct timezone file, located under that directory.

For example, I needed to set it to Auckland's time, which is done as follows:

ln -sf /usr/share/zoneinfo/Pacific/Auckland /etc/localtime

Good oh, that now saves me from having to Google how to do it next time ;)
No, I probably won't remember without having to look it up here again...

Related posts:

Comments

blog comments powered by Disqus