Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Feb 2000 15:46:14 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
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>
In-Reply-To: <Pine.LNX.4.10.10002181423360.28091-100000@mail.telestream.com>; from keith@mail.telestream.com on Fri, Feb 18, 2000 at 02:32:03PM -0800
References:  <Pine.LNX.4.10.10002181423360.28091-100000@mail.telestream.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* keith@mail.telestream.com <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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000218154614.Z21720>