Date: Sat, 08 Sep 2001 22:29:14 -0500 From: Randall Raemon <rlr@shikahrsoho.com> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/30451: command '/bin/date -f' not working as described Message-ID: <E15fvHW-000JDJ-00@tuvela.shikahrsoho.com>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E15fvHW-000JDJ-00>