Setting the timezone on CentOS
It’s a fairly simple operation. There are loads of timezone data files stored in:
So for my CentOS install, to set my machine time on runtime to London time(GMT), I use:
Check current time zone:
Wed Oct 1 07:43:58 CDT 2008
# # to fix it #
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
Now check it’s ok
Wed Oct 1 12:42:33 GMT 2008
Then to make sure the settings stay applied after a restart:
change the zone line to:
In order to get the particular zone you wish to use you must associate ZONE with a file located in /usr/share/zoneinfo. It is wise to note the directory structure because if you need to set the timezone to that of Shanghai which is located in the Asia directory you will then have to set your ZONE variable to the following :
Or perhaps you need to set the timezone to that of East Brazil :
Finally save the file /etc/sysconfig/clock and on next reboot the system will be set to the defined timezone.
2 thoughts on “How to – CentOS Server Timezone Change UK (GMT 0)”
Note vi worked for me, not VIM.