• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / Change the timezone on CentOS

Change the timezone on CentOS

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…

Didn’t work?

I’ve had some issues on a particular bunch of CentOS 5 virtual machines (I think they were all based on the same template) where doing the above didn’t work. I’ve written "fix the timezone data on CentOS" as a follow up post to show a possible solution.

Check Out These Related posts:

  1. Installing maildrop on CentOS 5
  2. Checking daylight savings settings on Linux
  3. New_Face failed error when using Mplayer
  4. Correcting the PHP timezone

Filed Under: Linux/Unix/BSD, Quick Tips

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap