skip down to the 3 comments

Setting the timezone on CentOS

I forget this pretty much all the time, even though it’s a fairly simple operation. There are loads of timezone data files stored in:

/usr/share/zoneinfo

So for my CentOS install, to set my machine to London time, I use:

#
# this is not correct for me
#
$ date
Wed Oct  1 07:43:58 CDT 2008
#
# to fix it
#
$ sudo rm /etc/localtime
$ sudo ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
#
# now check it's ok
#
$ date
Wed Oct  1 12:42:33 GMT 2008

I imagine this works on Redhat and Fedora as well, but I can’t be sure on other Linux distros.

There have been 3 responses to this post.

  1. John Trupiano

    This was helpful to me. Thanks!

  2. Jeremy Hoyland

    I linked in /usr/share/zoneinfo/Europe/London to localtime on the theory that it might get me summertime.

    I’ll find out in March!

  3. Duncan

    @jeremy you’re right :) and I’ve swapped mine too

Go ahead, have your say ..

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">


back to the top