bug-coreutils
[Top][All Lists]
Advanced

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

Re: problems w/ date


From: Bob Proulx
Subject: Re: problems w/ date
Date: Sat, 19 Mar 2005 11:10:45 -0700
User-agent: Mutt/1.5.6+20040907i

Hi Mike!

Mike Dunphy wrote:
> I have a debian 3.1 install and date reports UTC
> despite TZ=PST and /etc/timezone = US/Pacific
> [...]
> despite the time really being 7:30 am PST

What is the actual output of the date command?  What timezone is it
printing?  I don't believe this is a problem with GNU date.  Please
show us the GNU date output.  Here are examples from my system.

  date
  Sat Mar 19 10:54:36 MST 2005
                      ^^^

I prefer the RFC-2822 compliant date string because it avoids
confusion over name collisions in the world wide timezones.

  date -R
  Sat, 19 Mar 2005 10:54:49 -0700
                            ^^^^^

I prefer not to set the TZ variable at all and to use the system
default time.  But if you are setting it then you may need to use
PST8PDT instead of PST.

> Any ideas ?

What does /etc/localtime symlink to?  On my machine:

  ls -l /etc/localtime
  lrwxrwxrwx  1 root root 31 2005-02-01 23:31 /etc/localtime -> 
/usr/share/zoneinfo/US/Mountain

On Debian you can run the 'tzconfig' script to guide you through
reconfiguring the system timezone configuration.

  tzconfig

> ntp commands also are that way
> ntpdate corvallis.cns.hp.com
> 19 Mar 15:29:40 ntpdate[14761]: adjust time server 15.7.240.32 offset 
> 0.000424 sec

I believe NTP and other underlying time conventions should always be
in UTC.  It avoids much confusion.  If I recall correctly NTP always
operates in UTC.  This is also true of other things such as revision
control systems and things like that.

On a different but related topic is timezone of the hardware clock.
You can specify if the hardware system clock is UTC or a local
timezone.  This is useful when multi-booting less intelligent systems
that don't handle UTC time.  On Debian this is configured in the file
/etc/default/rcS with "UTC=yes" or "UTC=no".  Setting to "no" may
allow you to share the hardware system clock among multiple OSs.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]