NetBSD-Bugs archive

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

Re: misc/22221: Chicago time zone file problem



On Thu, Apr 03, 2008 at 09:45:03AM +0000, Martin Husemann wrote:
 >  Stupid question:
 >  
 >  env TZ=/usr/share/zoneinfo/America/Chicago date '+%z'
 >  
 >  outputs -0500 for me right now - is that wrong?

No. That's fine, because the US is in daylight time right now:

   % env TZ=America/Denver date +%z
   -0600
   % env TZ=America/Chicago date +%z
   -0500
   % env TZ=America/New_York date +%z
   -0400

The value that gets left in the global variable "timezone" is broken,
however:

   % env TZ=America/Denver ./test 
   25200
   % env TZ=America/Chicago ./test 
   18000
   % env TZ=America/New_York ./test 
   18000

Trying some other zones in America/, it looks as if whatever sets it
is honoring DST only for Chicago. Which is strange.

My test.c:

   #include <stdio.h>
   #include <time.h>

   int main(void) {
      time_t t;

      t = time(NULL);
      localtime(&t);
      printf("%ld\n", timezone);
      return 0;
   }

I think another valid question to raise is whether this global
variable needs to continue to be supported...

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index