I am going to show you a way that I use to set the local time on my Linux servers. It really isn't that hard either.
First, you should get NTP installed.
apt-get install ntp ntpdate
Next, just in case, make a backup of your already configured time.
mv /etc/localtime /etc/localtime-backup
Then we start to go into the process of getting the new local time file. We do this by going to /usr/share/zoneinfo.
cd /usr/share/zoneinfo
Once you reach this folder, there should be a list of folders of different countries. Go to the directory that you are located in. In this case, I am going to choose America.
Once you are in the folder of your country, there should be a bunch of cities that are in your country. Pick the closest city in your timezone. For example, I would choose Chicago. Then run the following command, changing, of course what needs to be changed to fit your needs.
ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime
Once you execute that command, the local time should be all set! To see the time on the machine, simply type "date" in the command line.
I hope this tutorial can be useful for you!


Sun, Aug 2, 2009
Linux