From owner-freebsd-questions Fri Feb 18 15:17:51 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 103B737BB2D; Fri, 18 Feb 2000 15:17:48 -0800 (PST) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) id PAA29880; Fri, 18 Feb 2000 15:46:15 -0800 (PST) Date: Fri, 18 Feb 2000 15:46:14 -0800 From: Alfred Perlstein To: keith@mail.telestream.com Cc: freebsd-questions@FreeBSD.ORG, jkh@FreeBSD.ORG Subject: Request for commit to 4.0. Re: Odd date output Message-ID: <20000218154614.Z21720@fw.wintelcom.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from keith@mail.telestream.com on Fri, Feb 18, 2000 at 02:32:03PM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * keith@mail.telestream.com [000218 15:01] wrote: > I'm running 3.4-Stable and have writen a realy nifty web based billing > program for us. In testing it I've run into a odd 'date' error that is > hosing my entire system. > > In portions of the script(s) I'm nabing the date as such > DATE=`/bin/date +%G%m%d` > All works fine there and I get what I want. > In other parts of the script(s) I use date in a different format > CURRENT_MONTH=`/bin/date +%m` > This also works fine with the desired output. > BUT,,, when I test things to make sure is all fine I step up the > CURRENT_MONTH with this command > CURRENT_MONTH=`/bin/date -v March +%m` > This works fine for EVERY month except for May. When I change the > CURRENT_MONTH to be > CURRENT_MONTH=`/bin/date -v May +%m` It errors out big time with this. > > ---------- > May: Cannot apply date adjustment > usage: date [-nu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] > ... > [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] > ---------- > > Any clue as to why it would work fine on all other date adjustments with > May being the execption? > > Thank you. er, a pretty funny ommision in vary.c, Jordan, may I apply this patch to -current and -stable? I guess it broke in going from 1.1 -> 1.2 :) Index: vary.c =================================================================== RCS file: /home/ncvs/src/bin/date/vary.c,v retrieving revision 1.7 diff -u -u -r1.7 vary.c --- vary.c 1999/08/27 23:13:59 1.7 +++ vary.c 2000/02/19 03:25:12 @@ -41,8 +41,8 @@ static struct trans trans_mon[] = { { 1, "january" }, { 2, "february" }, { 3, "march" }, { 4, "april" }, - { 6, "june" }, { 7, "july" }, { 8, "august" }, { 9, "september" }, - { 10, "october" }, { 11, "november" }, { 12, "december" }, + { 5, "may"}, { 6, "june" }, { 7, "july" }, { 8, "august" }, + { 9, "september" }, { 10, "october" }, { 11, "november" }, { 12, "december" }, { -1, NULL } }; thanks, -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message