www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/13/07:34:03

Date: Thu, 13 Apr 2000 11:24:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Larry Olin Horn <hornlo AT millsaps DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: timezone problems: tm_isdst not set; strftime("%z") is -0000
In-Reply-To: <200004121610.MAA01705@delorie.com>
Message-ID: <Pine.SUN.3.91.1000413112350.28180B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 12 Apr 2000, Larry Olin Horn wrote:

> > > Wrong time zone (CST instead of CDT)
> > No, it's not wrong.
> 
> I would call indicating the incorrect time, regardless of it's exact textual 
> expression, "wrong".
> 
> > The name printed by %Z is not documented to be 
> > identical to the TZ setting, or any part thereof.  It is simply a
> > string that identifies the time zone in some arbitrary way.
> > 
> > For example, I have a setting "TZ=israel", but %Z prints "JST" (for 
> > "Jerusalem Standard Time").
> 
> So?  The actual time zone is mis-identified, whether it's displayed as "CST", 
> "Central Standard Time", "-0600", or "UTC less six hours", because that's not 
> the time zone I'm in.  The time indicated is off by an hour from actual local 
> time.

I was only referring to the string.  The time printed is most
certainly not correct.

> Perhaps you misplaced "arbitrary" and meant to say "identifies an arbitrary 
> time zone in some way".
> 
> Would you accept "Jerusalem Daylight Time" or "JDT" as correct, while 
> Jerusalem Standard Time was in effect, just because "%Z" isn't documented to 
> duplicate the text of TZ?

The ANSI C standard says:

  "%Z" is replaced by the time zone name or abbreviation, or by no
       characters if no time zone is determinable.

This is so vague that virtually *any* result would be okay as far as
the standard is concerned.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019