Quoting Eric Gillespie, Jr. ([EMAIL PROTECTED]):
> On Wed, 13 Jan 1999, Edwin Martin wrote:
> 
> > The variable timezone doesn't seem to work right. It should give
> > the timedifference between GMT and the local timezone.
> > 
> > I live in Amsterdam, so the difference should be (-)3600 seconds.
> > But timezone tells me the difference is -1168 seconds, or about
> > 19 minutes! Bit strange, isn't it?
> > 
> > I use Debian Hamm, so my Linux is not that old. I can reproduce this
> > on two Hamm-computers, installed by different people.
> > 
> > Here's the code:
> > 
> > // timetest.c
> > 
> > #include <stdio.h>
> > #include <time.h>
> > 
> > main() {
> >         time_t t;
> > 
> >         t = time( NULL );   // dummy instruction for localtime()
> >         localtime( &t );    // sets tzname and timezone 
> > 
> >         printf( "tzname=[%s,%s]\n", tzname[0], tzname[1] );
> >         printf( "timezone=%ld\n", timezone );
> > }
> > 
> > And this is the output:
> > 
> > tzname=[CET,CEST]
> > timezone=-1168
> > 
> > tzname Is correct, but timezone is not.

[snip]

> 
> I've noticed a similar problem on my system. I first noticed me when
> someone pointed out to me that my mail's time says "-0600 (EST)" which is,
> of course, incorrect. It should read CST. I asked what was going on once,
> but no one responded. I ran your little program and got this output:
> tzname=[EST,CDT]
> timezone=21600
> 
> That should be CST,CDT and 3600. Does anyone know what's going on here?
> 
> I almost forgot. I did not have this problem under bo. It began with hamm
> and has continued into slink.

Well I've had a different but possibly related problem, which is that
transferring files by FTP inside mc can cause their timestamps to shift
by an hour which means that zip and unzip -f or -u suddenly start
working overtime. I THINK this happened between bo and hamm machines,
but because I phased hamm in during late October, the problem could
easily be related to the clock change.

My (fresh hamm) system has the system clock on GMT, and has been told
that. The timezone was configured at installation as GB.

When I logon, the TZ environment variable is unset. The program yields
tzname=[GMT,BST]
timezone=-3600
(the latter is wrong, of course).

I observe the following:

$ export TZ=GMT0BST        tzname=[GMT,]        timezone=18000

$ export TZ=GB             tzname=[GMT,BST]     timezone=-3600

$ export TZ=GMT0           tzname=[GMT,GMT]     timezone=0

$ export TZ=               tzname=[UTC,UTC]     timezone=0

$ unset TZ                 tzname=[GMT,BST]     timezone=-3600

Should I add export TZ= to /etc/profile and would this help my
daemons? Come 28th March, I will be repeating this experiment.
Perhaps I should run tzconfig twice a year.

So obvious questions are what do you have your machines
configured to, and is TZ set to anything.

A more general question is where time zones are documented.
Quite a few changes have been made in this area, some to do
with Posix. Documentation is spread around man pages, the
kernel source files etc. but there's no good overview, is
there.

Cheers,

-- 
Email:  [EMAIL PROTECTED]   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.

Reply via email to