Setting the Time Zone on Fedora from the shell

By default Fedora set’s the timezone to UTC, during the install you may change this. But, if you move a server or forget to set the timezone during install.  You may change it after the fact.

Lately I  moved a system from the EST to CST (From Virginia to Minneapolis).  Since this was a webserver, there is no GUI installed (wasting memory).  So I connected to the system via SSH and ran the following command:

cp /usr/share/zoneinfo/America/Chicago /etc/localtime

All your really doing is copy the timezone info for Chicago, into the local systems clock.

To get a list of your time zone, on Fedora, go to your “/usr/share/zoneinfo” directory and list the contents.

cd /usr/share/zoneinfo/
ls

This will give you a list of all the top level regions, find yours and go into it.

cd America

Now find the city that’s closest to you and in your same timezone.

So if your in the Central time zone, copy the Chicago file into your “/etc/localtime” file

cp Chicago /etc/localtime

now check to make sure it all worked.

$ date
Sun Aug 23 15:10:03 CDT 2009

Since this system is in Minneapolis, and Minneapolis is in the CST/CDT I’m good to go.