Posted by: nakuls77 | September 14, 2008

Changing server time/date & timezone

SSH to your server as root and change directory to:
/usr/share/zoneinfo

Perform an ls –l on the directory and you will see a variety of timezones. To set the server’s local timezone, you will want to copy the timezone file for your timezone and replace the file called /etc/localtime.

For example:
cp EST /etc/localtime

Now that you have configured the proper timezone for your server, you will want to have the time adjusted for your timezone. Perform the following command to have your server contact a remote NTP server and re-establish the proper time:

rdate -s time.nist.gov

Afterwards, you will want to set your hardware clock to the same as well. Use the following command to do this:
/sbin/hwclock –systohc

And that’s it you’ve sucessfully set the date & time as per your preferance.


Leave a response

Your response:

Categories