Setting Debian Etch time and timezone

by Olavi Räinä

This article tells how to set server time and date on Linux. Example is for Debian Etch, but same principle works with other Linux distributions.


You can set your server time manually by typing

date 081517112007

this sets your time to 15th of August 17:11, year 2007.

But we recommend that one sets up the server to check automatically time from NTP servers.

Using NTP

Automatic time checking and adjusting can be accomplished with NTP (Network Time Protocol). NTP is used to synchronize the computer clock over net.

This is how you set NTP in Debian:

apt-get install ntp apt-get install ntpdate

If everything goes right NTP service should start automatically after apt-get install command.

You can see if you are running NTP client by typing command:

ntpq -p

This command runs NTP query and option -p tells to print the list of servers that are named in /etc/ntp.conf (and also diplays their status).

Setting timezone

Set your timezone with command:

tzconfig

Follow up by choosing the right answers to questions that command line “wizard” is asking.

Finally check the changes with command:

date

I had answer:

Wed Aug 15 17:06:53 EEST 2007

And I was pleased with that answer, since my server is in Finland (EEST) and time and date was exactly right.

Comments

Ari Pietarinen -- 14. January 2008

In Ubuntu this was needed to get ntpd server going:

sudo apt-get install ntp-simple

Russell Endicott -- 25. February 2008

Awesome. Thank You. This worked in Debian 4.0 Etch and fixed Orage and Clock applets that weren’t changing timezones before.

Add your comment:

(Will not be displayed)
Textile Help

Comments