Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2000 16:47:05 +0200
From:      Bernd Luevelsmeyer <bernd.luevelsmeyer@heitec.net>
To:        Phil Pennock <pdp@nl.demon.net>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/20159: strftime() can't produce ISO8601 format timezone representation
Message-ID:  <397DA869.B1C9660C@heitec.net>
References:  <E13GqO3-000HRe-00@samhain.noc.nl.demon.net> <200007242210.PAA15988@freefall.freebsd.org> <20000725002527.A67116@samhain.noc.nl.demon.net> <397CD82D.F67AA13E@heitec.net> <20000725134616.A71153@samhain.noc.nl.demon.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Phil Pennock wrote:
> 
> On 2000-07-25 at 01:58 +0200, Bernd Luevelsmeyer wrote:
[...]
> > I think if strftime() were to be modified then the implementation ought
> > to follow the C99 Standard.
> 
> Fine by me.  Would you like an alternate patch, or is the one which I
> supplied an adequate base?

I don't consider myself to be knowledgeable enough to judge if your
patch is adequate. Although I have been programming C for some time, I'm
only just beginning with FreeBSD. For example, 'tm_gmtoff' is news to
me, as are '_add' and '_conv'. But, judging from the names, it looks
adequate.

However, In my /usr/src/lib/libc/stdtime/strftime.c (4.1-RC as of Mon
Jul 17) both 'Z' and 'z' are already implemented (in a way almost
equaling your patch). I suggest to migrate that source back into 3.5, in
order to avoid source splitting.
(The 4.1-RC source still has the problem of asking is tm_isdst is ==1
(should be >0), and it uses a '?' if the TZ is unknown (should be
nothing).)


> > FreeBSD's not documenting may be due to the fact that the system is
> > always running in a known TZ, defaulting to UTC.
> 
> So is there a supported method for an application which doesn't want to
> reveal its timezone to do this with strftime(), other than just
> hardcoding the string -0000 into the format string and handling this
> logic at a higher level?

I'd say, strftime() cannot, if asked to provide the timezone, lie about
it. The application ought not to ask for %z or %Z if it doesn't want the
TZ in the string IMHO.


> The use of -0000 comes from use in various rfc822-style headers -
> primarily Received: - although I don't have a handy reference indicating
> the appropriate RFC - it's not 822.

I guess (but don't know as a fact) that these mail servers are really
running in UTC? I can't think of a reason why a mail server should want
to hide its timezone.


Greetings,
	Bernd


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?397DA869.B1C9660C>