We run multiple websites on multiple servers so it’s fairly important that we can synchronise the time-zones on all these different boxes.
We found the Linux process of changing time-zone a little quirky, so we thought we would note it down here for future reference.
I think the following applies to most flavours of Linux, but we’re specifically using Ubuntu Dapper Drake in this example.
First of all, you’ll probably want to check the time and date on your box, to do this log-in via SSH and type the following command at the prompt:
date
You should then see the current time and date in this format:
Mon Aug 13 09:30:19 EDT 2007
OK, so let’s change our time-zone from EDT to something else. The server time-zone is controlled by a file called localtime, this file is a symbolic link to the specific time zone file. This file can be found in the etc/ folder, the specific time zone files can be found in usr/share/zoneinfo/. So, we just need to re-write the localtime sym link and re-point it. Working in the etc/ folder which contains localtime, type:
ln -sf /usr/share/zoneinfo/EST localtime
Now, when you check the time and date, you should that it now displays a different time and zone:
Mon Aug 13 06:45:02 PST 2007
There you have it, time-zone changed!
There are lots of options in the zoneinfo folder, take a look inside to see what you can use.
Related posts:
{ 1 trackback }
{ 2 comments… read them below or add one }
I am trying this ..but i am getting Error permission denied …please suggest
Use
sudobefore the command that is failing.