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



The following reply was made to PR misc/22221; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: misc-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
        netbsd-bugs%netbsd.org@localhost, joe%laffeycomputer.com@localhost, 
martin%duskware.de@localhost
Subject: Re: misc/22221: Chicago time zone file problem
Date: Thu, 3 Apr 2008 14:17:49 +0000

 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