How to fix wrongly configured timezone in Debian GNU/Linux and Ubuntu

Wednesday, 3rd August 2011

During the install of a new Debian GNU/Linux server I was in a real hurry, so I mistakenly choose a wrong timezone of US/Pacific

As a consequence the server date and time was incorrect and I had to fix that to adjust to the proper server location which of this case was:Europe/London

Here is the quick fix:

debian:~# dpkg-reconfigure tzdata

Next I choose my timezone from the ncurses interface navigating with arrow keys and used ntpdate to synchronize the time for the server like so:

debian:~# ntpdate time.nist.gov
3 Aug 16:02:26 ntpdate[26658]: adjust time server 192.43.244.18 offset 0.000802 sec

Done 😉

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

2 Responses to “How to fix wrongly configured timezone in Debian GNU/Linux and Ubuntu”

  1. admin says:

    There are few more ways to achieve the same without using dpkg-reconfigure.

    One other way is to directly link or copy the timezone you prefer:
    #cp -rpf /etc/localtime /etc/localtime.orig
    # cp -rpf /usr/share/zoneinfo/Europe/London /etc/localtime
    #ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

    However this method is not recommended IMHO 🙂

  2. admin says:

    Another handy tip is.
    Changing the Time Zone per user level:
    This can be done with cmd:
    # setenv TZ Europe/Sofia

Leave a Reply