Re: Re: timezone = 1168 ???

1999-01-14 Thread David Wright
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=GMT0BSTtzname=[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.


timezone = 1168 ???

1999-01-13 Thread Edwin Martin
Hello,

I walked into a strange problem.

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.

Can anybody explain this? Is this a bug in glibc or something?

Thanx,
Edwin Martin.


---
The world is moving so fast these days
that the person who says it can't be done
is generally interrupted by someone doing it.
-- Harry Emerson Fosdick


Re: timezone = 1168 ???

1999-01-13 Thread Eric Gillespie, Jr.
On Wed, 13 Jan 1999, Edwin Martin wrote:

 Hello,
 
 I walked into a strange problem.
 
 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.
 
 Can anybody explain this? Is this a bug in glibc or something?
 
 Thanx,
 Edwin Martin.
 
 
 ---
   The world is moving so fast these days
   that the person who says it can't be done
   is generally interrupted by someone doing it.
   -- Harry Emerson Fosdick
 
 

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.

/--\
| pretzelgod | [EMAIL PROTECTED]   |
| (Eric Gillespie, Jr.)  | [EMAIL PROTECTED]|
|---*|
| That's the problem with going from a soldier to a   |
|  politician: you actually have to sit down and listen to |
|  people who six months ago you would've just shot.  |
|  --President John Sheridan, Babylon 5|
\--/


Re: timezone = 1168 ???

1999-01-13 Thread Oliver Elphick
Eric Gillespie, Jr. wrote:
  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 can't comment on why you're getting EST instead of CST, but 21600 is
surely correct for a 6 hour difference from UTC.

-- 
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver
   PGP key from public servers; key ID 32B8FAA1
 
 Wherefore let him that thinketh he standeth take heed 
  lest he fall.I Corinthians 10:12 



Re: timezone = 1168 ???

1999-01-13 Thread Eric Gillespie, Jr.
On Wed, 13 Jan 1999, Oliver Elphick wrote:

 I can't comment on why you're getting EST instead of CST, but 21600 is
 surely correct for a 6 hour difference from UTC.
 
 -- 
 Oliver Elphick[EMAIL PROTECTED]
 Isle of Wight  http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
  
  Wherefore let him that thinketh he standeth take heed 
   lest he fall.I Corinthians 10:12 
 
 
 
 -- 
 Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null
 

You're right, I don't know why I was counting minutes instead of seconds.
The real problem is, of course, the EST.

/--\
| pretzelgod | [EMAIL PROTECTED]   |
| (Eric Gillespie, Jr.)  | [EMAIL PROTECTED]|
|---*|
| That's the problem with going from a soldier to a   |
|  politician: you actually have to sit down and listen to |
|  people who six months ago you would've just shot.  |
|  --President John Sheridan, Babylon 5|
\--/