From owner-freebsd-bugs Sat Sep 8 20:40: 9 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BCD6B37B40C for ; Sat, 8 Sep 2001 20:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f893e1N99161; Sat, 8 Sep 2001 20:40:01 -0700 (PDT) (envelope-from gnats) Received: from dmz.shikahrsoho.com (mail.shikahrsoho.com [209.198.142.219]) by hub.freebsd.org (Postfix) with ESMTP id 8723437B40D for ; 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: Date: Sat, 08 Sep 2001 22:29:14 -0500 From: Randall Raemon Reply-To: postmaster@shikahrsoho.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/30451: command '/bin/date -f' not working as described Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30451 >Category: bin >Synopsis: command '/bin/date -f' not working as described >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Sep 08 20:40:01 PDT 2001 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message