[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: timezones and time setting

on Sun, Dec 02, 2001 at 09:44:51AM +0100, J.H.M. Dassen (Ray) (dm@zensunni.demon.nl) wrote:
> On Sun, Dec 02, 2001 at 13:01:29 +1030, David Purton wrote:

> > Is there a how-to or reference somewhere that explains the whole
> > timezone/time stting thing?
> Not that I'm aware of.

Some system admin texts will cover this to an extent.  It's somewhat
one of those "you just know" things though.

> > There are lots of points which I don't quite follow...
> > 
> > like when I should use the (numerous) various different commands for
> > setting the time.

> Probably the only one that is directly relevant to your situation is
> hwclock(8). Programs and packages like rdate and in particular ntpdate
> and xntp are important if you want to fetch the time from or keep your
> time in sync with a remote system with presumably a more accurate
> clock (e.g.  coupled to an atom clock).
> Linux deals with two clocks: the system clock, maintained by the
> kernel, and the hardware clock (the BIOS clock). hwclock can be used
> to set one from the other.

I'd like to add to that.

  - hwclock:  used to query and set the hardware (BIOS) clock.  Mostly
    used to specify the BIOS timezone, which should be GMT under
    GNU/Linux.  The exception is when dual-booting a legacy MS Windows
    box, in which case you're stuck with local TZ on the hwclock.

  - tzconfig:  utility used to set the standard system timezone.  This
    is the timezone the system _reports_ for various functions
    (including logs and a user's default time settings), but _doesn't_
    change the time basis of the hardware clock.

  - date:  query or set the system clock.  You can set date directly (as
    root) using date.  This is seldom done.

  - ntpdate, ntpd:  synchronize your system clock with a network
    timeserver, for accuracy to 0.002 - 0.500 seconds, depending on
    circumstances.  'ntpdate' is intended to be run once (usually at
    boot), to get the system clock (with large adjustments possible)
    into alignment with the timeserver.  'ntpd' by contrast makes
    smaller adjustments (including, possibly, running the system clock
    faster or slower over a period of time to bring time into
    alignment).  If the time delta is too large, ntpd will not adjust
    the system time (1000 seconds, or about 16 minutes, 45 seconds).
    Time is generally "slewed" into alignment.

    I use ntpd and recommend it for those wanting to keep accurate time.

  - $TZ:  the timezone environment variable.  This can be used to
    specify the time zone a specific process should honor.  For example,
    if you wanted to start a clock showing current time in Sydney, you
    could run:

        $ TZ=Australia/Sydney xclock 

> > Is linux supposed to automatically adjust for daylight saving times,
> It is, provided you keep your hardware (BIOS) clock in UTC.

Actually, it does regardless of whether you're using UTC or a local

However, your legacy MS Windows system will muck with the time around
the DLST transition if you dual boot.


Karsten M. Self <kmself@ix.netcom.com>       http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?             Home of the brave
  http://gestalt-system.sourceforge.net/                   Land of the free
   Free Dmitry! Boycott Adobe! Repeal the DMCA! http://www.freesklyarov.org
Geek for Hire                     http://kmself.home.netcom.com/resume.html

Attachment: pgpbzhwOasnEK.pgp
Description: PGP signature

Reply to: