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 😉

Share this on:

Download PDFDownload PDF

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

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

  1. admin says:
    Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
    Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

    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 🙂

    View CommentView Comment
  2. admin says:
    Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
    Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

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

    View CommentView Comment

Leave a Reply

CommentLuv badge