Check your current timezone.
Log in as root. Open the terminal and check which timezone your machine is currently using by executing the date command. The terminal will display the date in the following format:
Mon Aug 12 12:15:08 PST 2013. PST in this case refers to the current timezone (Pacific Standard Time).
Select your timezone region.
Change to the directory /usr/share/zoneinfo. A list of time zone regions will be displayed.
The /usr/share/zoneinfo directory may vary depending on your Linux distribution.
Backup your old timezone settings.
If you wish, backup the previous timezone configuration by renaming it to a backup name. Use the following command
mv /etc/localtime /etc/localtime-old
Link your machine’s clock to a city in your timezone.
Use the following command, replacing the region and city with your appropriate entries:
ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
If your city is not listed in the timezone list, pick one from your same timezone.
Verify that your timezone has been set.
Run the date command again and check that the timezone corresponds to the one you just changed to.
Set your clock to stay synced with internet time servers.
Most modern distributions have NTP already installed. If you do not, you will need to install the NTP server package. Use the following commands to install it, depending on your Linux distribution:
Ubuntu/Debian: sudo aptitude install ntp
CentOS: sudo yum install ntp
sudo /sbin/chkconfig ntpd on
Fedora/RedHat: sudo yum install ntp
sudo chkconfig ntpd on
Enter the ntpdate command: ntpdate && hwclock –w
There are a variety of public time servers available to connect to. You can find listings online.
No comments:
Post a Comment