Add Comment

You are not currently logged in. If you do not have a user account then please consider creating one and logging in before you post your comment. This will allow you to track replies to your comment, and take part in the site much more freely.

To add your comment, fill in all the boxes below and then preview it to make sure you're happy with the way that it looks.

This is the comment you were replying to, attached to the article Changing the timezone of your Debian system:


Wrong! Misinformation!
Posted by Anonymous (24.68.xx.xx) on Fri 22 Jun 2007 at 08:23
This article is embarassing. This is not the way to change the timezone for your machine. The guy's link to tzconfig is correct.

tzselect will only change the timezone of your current shell. It is not even permanent (as will be explained when you run the command to completion).

I suggest this article be deleted so as not to spread misinformation.

This is how time works in Linux, and probably every other Unix.

Internally, the system keeps time in UTC. (French acronym for universal co-ordinated time, I believe). Same as GMT (Greenwich Mean Time). Look it up in Wikipedia.

/etc/localtime has the timezone that was selected when you installed the system.

It has stuff like:
1) offset in seconds from UTC
(there are a number of places that are 6.5 hours off UTC, and Nepal is +5 hours and 45 minutes! (though Nepal's capital Kathmandu is misspelled Katmandu))
2) whether daylight savings time applies to that timezone, and when daylight savings time applies
(as it can happen in different regions at different times, or not at all).

/etc/timezone is a file that has one line, the currently selected timezone. When you run tzconfig, it updates both /etc/localtime, and writes the timezone you selected in /etc/timezone. (At least on Debian versions Sarge and Etch...Woody didn't keep the timezone in /etc/timezone, but /etc/localtime was a soft-link to the timezone selected, so you could find out that way).

(All Linux distributions use /etc/localtime (well, all the ones I know about), but /etc/timezone is a Debian thing (probably Debian derivatives like Ubuntu and such as well). Redhat derived distributions like Fedora use /etc/sysconfig/clock to hold the currently selected timezone (plus whether your hardware clock is in UTC or not).

When an application needs the localtime, the system takes UTC (which is what the system is using internally), and applies the /etc/localtime information to it, to get your localtime.

If you have an environment variable called 'TZ' set to a different timezone, it will use that timezone instead of the one copied to /etc/localtime.

So, calling tzselect will only set your TZ environment for your current shell, and any programs started from that shell. The system will still use /etc/localtime for all other applications.

NTP will not do anything about daylight savings time. It is just a good source for the system to find out what UTC is. All daylight savings time info comes from /etc/localtime (or the timezone set in your TZ environment).

Perhaps it is needless to say, but you shouldn't muck with /etc/localtime and /etc/timezone yourself. Use tzconfig, as it will update both correctly, and possibly do some other stuff.

The rule of thumb for the UTC setting in /etc/default/rcS is that if your machine is not dual-booted, you can set UTC to yes. This simplifies things because UTC does not jump around based on daylight savings time, so when you boot after daylight savings time, the system doesn't have to guess whether the clock has been updated or not.

But if you dual boot with Windows, Windows will expect the hardware clock to be your localtime, so you should set UTC to no. Note: if you set UTC to yes, if you go into your BIOS, to change the clock, you will need to set it to UTC, as that is what the system will expect when booting. You'll probably notice soon enough that something is wrong.

Oh, and changing the UTC setting in /etc/default/rcS does not require a reboot. True, the clock will not be set until you shutdown properly and the system writes the UTC to the clock, but nothing requires you to do that after modifying that value.

Username:Anonymous
Title:
Your Comment:

Posting Format:

 

Inappropriate comments will be removed.

Some help on entry formatting is available

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search