From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 29 10:56:03 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEE3216A4B3 for ; Mon, 29 Sep 2003 10:56:03 -0700 (PDT) Received: from booch.minidns.net (c-67-160-219-187.client.comcast.net [67.160.219.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA4014400B for ; Mon, 29 Sep 2003 10:56:02 -0700 (PDT) (envelope-from brian@dessent.net) Received: from [127.0.0.1] (helo=dessent.net) by booch.minidns.net with esmtp (Exim 4.22) id HLZLTD-00023S-OO for freebsd-bugs@FreeBSD.ORG; Mon, 29 Sep 2003 10:56:01 -0700 Message-ID: <3F787231.4F13AB6E@dessent.net> Date: Mon, 29 Sep 2003 10:56:01 -0700 From: Brian Dessent Organization: My own little world... X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,en-US MIME-Version: 1.0 To: freebsd-bugs@FreeBSD.ORG Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: strptime() in libc has a manpage error X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 17:56:03 -0000 Apologies for not using send-pr, however the freebsd.org mailserver will not accept mail from the freebsd system that I have access to, because it does not have a reverse DNS entry. That aspect of DNS is out of my control (and I've asked) so that leaves me with no way to use 'send-pr'. I really wish your mailserver weren't so restrictive. Anyway... The manpage for strptime(3) claims that "all conversion specifications are identical to those described in strftime(3)". strftime(3) claims to support "%z", as follows: ----- %z is replaced by the time zone offset from UTC; a leading plus sign stands for east of UTC, a minus sign for west of UTC, hours and minutes follow with two digits each and no delimiter between them (common form for RFC 822 date headers). ----- However, the code for strptime() contains no such conversion specifier, and this manpage entry is just wrong. You can easily verify this by looking at the code for strptime: which clearly has no provision to handle the "%z" case. This can be demonstrated with the following perl command (which calls the libc strptime() directly): ----- $ perl -MTime::Piece -e \ '$ts = Time::Piece->strptime("29/Sep/2003:17:19:55 -0700", "%d/%b/%Y:%H:%M:%S %z"); print $ts->cdate;' garbage at end of string in strptime: -0700 at /usr/local/lib/perl5/site_perl/5.6.1/mach/Time/Piece.pm line 442. Mon Sep 29 17:19:55 2003 ----- FreeBSD RELENG_4_8 i386, yadda yadda yadda Lets just say that this has resulted in much hair pulling and cursing at perl, only to discover that the FBSD manpage is flat out wrong. Brian