www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/22/05:35:40

Date: Fri, 22 Dec 2000 12:02:34 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: news AT jgreen4 DOT fsnet DOT co DOT uk
Message-Id: <2561-Fri22Dec2000120234+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp AT delorie DOT com
In-reply-to: <ku454tke181c70f6rimuamfd2pc9p0blfk@4ax.com> (message from Jason
Green on Thu, 21 Dec 2000 23:52:44 +0000)
Subject: Re: strftime: Need Help with Time Offsets
References: <1a524t0tk28cmv3vqfq26tooe0qeikhgm5 AT 4ax DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 1001221110346 DOT 28580O-100000 AT is> <ku454tke181c70f6rimuamfd2pc9p0blfk AT 4ax DOT com>
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

> From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
> Date: Thu, 21 Dec 2000 23:52:44 +0000
> 
> > > There appears to be a bug in strftime() when using the %z format.
> > 
> > The bug, whether it exists or not, does not necessarily have anything
> > to do with what Felix reported: I replied to his message saying I
> > cannot reproduce the problem.  His test program wroked for me.  I
> 
> Perhaps you could try my test program too, and tell if it does what
> you expect it should?

I get similar results to what you reported:

    Fri, 22 Dec 2000 09:53:58 +0000 GMT
    Fri, 22 Dec 2000 11:53:58 +7200 IST
    Thu, 21 Dec 2000 21:19:58 -0000 TEST1
    Fri, 22 Dec 2000 22:27:58 +38040 TEST2

I.e., the issue with negative offsets is reproducible.  But that's not
what the original message was talking about, IIRC.  The results in the
original message were completely bogus, which I couldn't reproduce.

> The POSIX Programmer's Guide isn't too helpful on this matter.  It
> lists: "%z Time zone.", %Z isn't listed.
> 
> The Linux man page for strftime() is better:
> 
>        %z     The time-zone as hour offset from GMT.  Required to
>               emit  RFC822-conformant  dates (using "%a, %d %b %Y
>               %H:%M:%S %z"). (GNU)

The library used by GNU/Linux systems, the glibc, already supports the
new C99 ANSI standard, which codifies the %z format.  The DJGPP
library is much older than glibc, and doesn't yet support C99; the
lack of support for %z is a minor nuisance compared to some major new
functionality that C99 warrants but DJGPP doesn't support.

Volunteers are welcome to work on adding C99 functionality to the
library.

> Maybe you have a copy of the ANSI standard to check on this?

It isn't mentioned at all in ANSI C89, which is what DJGPP supports.
And the info in Posix doesn't tell anything about the units, as you
cite above.

- Raw text -


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