From rlr@shikahrsoho.com  Sat Sep  8 20:35:17 2001
Return-Path: <rlr@shikahrsoho.com>
Received: from dmz.shikahrsoho.com (mail.shikahrsoho.com [209.198.142.219])
	by hub.freebsd.org (Postfix) with ESMTP id 8723437B40D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  8 Sep 2001 20:35:16 -0700 (PDT)
Received: from tuvela (tuvela.shikahrsoho.com) [192.168.5.2] 
	by dmz.shikahrsoho.com with esmtp 
	id 15fvHX-0002LL-00; Sat, 8 Sep 2001 22:29:15 -0500
Received: from rlr by tuvela.shikahrsoho.com
	with local
	id 15fvHW-000JDJ-00; Sat, 08 Sep 2001 22:29:14 -0500
Message-Id: <E15fvHW-000JDJ-00@tuvela.shikahrsoho.com>
Date: Sat, 08 Sep 2001 22:29:14 -0500
From: Randall Raemon <rlr@shikahrsoho.com>
Reply-To: postmaster@shikahrsoho.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: command '/bin/date -f' not working as described
X-Send-Pr-Version: 3.2

>Number:         30451
>Category:       bin
>Synopsis:       command '/bin/date -f' not working as described
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 08 20:40:01 PDT 2001
>Closed-Date:    Mon Sep 10 03:51:00 PDT 2001
>Last-Modified:  Mon Sep 10 03:51:10 PDT 2001
>Originator:     Randall Raemon
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
>Environment:

	

>Description:

	

   The man page, and the help usage for the /bin/date command
   describe a way to parse a date format using the -f parameter.

   Specifically:

      usage: date [-nu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]

   This implies that '-f' takes 2 parameters, the format and the
   date to be parsed.

>How-To-Repeat:

	

   For example:

      date -u -j -f '%s' 1000000000

   should return a date of Sun 9 Sep 2001 about 0205 GMT

   Instead, I get back:

Warning: Ignoring 10 extraneous characters in date string (1000000000)
Sun Sep  9 03:20:06 UTC 2001  (which happens to be the current time)

   Aside, I was curious as to when the clock/odometer rolled over.
   It led me to try out the date command parameters...

>Fix:

   I eyeballed the code in /usr/src/bin/date/date.c It looks like the
   code takes only 1 parameter, so there is some kind of mismatch
   between what the code is doing, and what the usage/manpage are
   saying. By default, the code wins...

>Release-Note:
>Audit-Trail:

From: Ulf Zimmermann <ulf@alameda.net>
To: freebsd-gnats-submit@FreeBSD.org, postmaster@shikahrsoho.com
Cc:  
Subject: Re: bin/30451: command '/bin/date -f' not working as described
Date: Sun, 09 Sep 2001 01:05:25 -0700

 I can not reproduce the problem as described in the "How-To-Repeat":
 
 playtoy ulf bin/date > date -u -j -f '%s' 1000000000
 Sun Sep  9 01:46:40 UTC 2001
 
 The command is as cut+paste'ed from the PR. As to the code only taking 
 one argument that is incorrect. The second argument given to setthetime 
 is *argv, which in this case would be "1000000000". I tried this on 
 4.4-RC/-Stable.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Mon Sep 10 03:51:00 PDT 2001 
State-Changed-Why:  
Problem fixed in later releases. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30451 
>Unformatted:
