From owner-freebsd-bugs Tue Jul 25 7:46:46 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from christel.heitec.net (christel.heitec.net [212.204.92.3]) by hub.freebsd.org (Postfix) with ESMTP id 62A7F37B52B for ; Tue, 25 Jul 2000 07:46:39 -0700 (PDT) (envelope-from bernd.luevelsmeyer@heitec.net) Received: from heitec.net (paladin.heitec.net [212.204.92.251]) by christel.heitec.net (Postfix) with ESMTP id 3CE8B354811; Tue, 25 Jul 2000 16:50:54 +0200 (CEST) Message-ID: <397DA869.B1C9660C@heitec.net> Date: Tue, 25 Jul 2000 16:47:05 +0200 From: Bernd Luevelsmeyer Organization: Heitec AG X-Mailer: Mozilla 4.04 [en] (WinNT; I) MIME-Version: 1.0 To: Phil Pennock Cc: freebsd-bugs@FreeBSD.org Subject: Re: misc/20159: strftime() can't produce ISO8601 format timezone representation References: <200007242210.PAA15988@freefall.freebsd.org> <20000725002527.A67116@samhain.noc.nl.demon.net> <397CD82D.F67AA13E@heitec.net> <20000725134616.A71153@samhain.noc.nl.demon.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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