From owner-freebsd-hackers Thu Jul 31 19:08:56 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA17609 for hackers-outgoing; Thu, 31 Jul 1997 19:08:56 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA17601 for ; Thu, 31 Jul 1997 19:08:51 -0700 (PDT) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) with ESMTP id LAA01674; Fri, 1 Aug 1997 11:38:43 +0930 (CST) From: Greg Lehey Received: (grog@localhost) by freebie.lemis.com (8.8.6/8.6.12) id LAA08172; Fri, 1 Aug 1997 11:38:39 +0930 (CST) Message-Id: <199708010208.LAA08172@freebie.lemis.com> Subject: Re: date(1) In-Reply-To: <199708010131.CAA21758@awfulhak.org> from Brian Somers at "Aug 1, 97 02:31:14 am" To: brian@awfulhak.org (Brian Somers) Date: Fri, 1 Aug 1997 11:38:39 +0930 (CST) Cc: hackers@freebsd.org (FreeBSD Hackers) Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Brian Somers writes: >> On Wed, 30 Jul 1997 grog@FreeBSD.ORG wrote: >> >>>>>>>>>> yy[mm[dd[hh]]]]mm[.ss]] >> >> At risk of missing the obvious, why can't the above simply be >> extended to >> >>> cc[yy[mm[dd[hh]]]]]mm[.ss]] > > Yep. As I suggested. > >> ? This format strikes me as being right since any usually, if the >> date is off by a large amount (eg. centuries), the year, month, day, >> hour, and minute will also be off. However, the date being off by a >> minute or two, while the hour, day, month, year, and century are >> correct is not unusual. >> >> This seems to avoid the below monstrosities. >> >>>>> [[[cc]yy[mm[dd[hh]]]]mm[.ss]] >>>>>> cc[yy[mm[dd[hh]]]]]mm[.ss]] >> >> The first is hopelessly ambigious and the 2nd is hopelessly >> annoying. > > The first is just wrong, and the second is a mis-quote. I originally > said: > >> More like: >> >>>> cc[yy[mm[dd[hh]]]]]mm[.ss]] >> >> (you can't have the century without the year). I think this confusion is making my point: the syntax is too complicated. I understand the [...] to mean optional parts. In this case, we have two unbalanced ]s: cc[yy[mm[dd[hh]]]]]mm[.ss]] ^ ^ | | Ignoring this problem, this syntax can be expanded to: cc[yy[mm[dd]]]mm[.ss] cc[yy[mm]]mm[.ss] cc[yy]mm[.ss] ccmm[.ss] cc[yy[mm[dd]]]mm cc[yy[mm]]mm cc[yy]mm ccmm So 'date 2001' must mean "set the date to century 20, year undefined, month, day, and hour undefined, minute 1. Most newcomers to UNIX hate date(1) because the date entry format is already too cryptic. This would just make it worse. There are some other alternatives for date entry--tar uses one, for example, though it may be GNU code. Why not base an implementation on one of those? Greg