Setting Local Time on a Linux Server

Sun, Aug 2, 2009

Linux

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!

, ,

This post was written by:

- who has written 4 posts on Tuts4Tech.

Adam, who also goes by his online nickname: gamerx287, is a tech enthusiast, geek, and high school student in Louisiana. He has been into technology since he was about 6 years old. He started using his nickname, gamerx287, back in August of 2007 when he bought the website, gamerx287.com. He has numerous computers and servers distros, even a server rack in his room! His computers run just about everything from Windows to Mac OS X to a few Linux. If you need any tech questions answered, you can email him or come to his chat @ live.gamerx287.com.

Contact the author

Leave a Reply