From owner-freebsd-hackers Mon Jul 28 20:48:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA03743 for hackers-outgoing; Mon, 28 Jul 1997 20:48:49 -0700 (PDT) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA03735 for ; Mon, 28 Jul 1997 20:48:41 -0700 (PDT) Received: from awfulhak.org (dev.lan.awfulhak.org [10.0.1.5]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id EAA19123; Tue, 29 Jul 1997 04:33:19 +0100 (BST) Received: from dev.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.org (8.8.6/8.8.6) with ESMTP id EAA20583; Tue, 29 Jul 1997 04:33:18 +0100 (BST) Message-Id: <199707290333.EAA20583@awfulhak.org> X-Mailer: exmh version 2.0zeta 7/24/97 To: Michael Smith cc: brian@awfulhak.org (Brian Somers), freebsd-hackers@FreeBSD.ORG Subject: Re: date(1) In-reply-to: Your message of "Tue, 29 Jul 1997 12:41:47 +0930." <199707290311.MAA09780@genesis.atrad.adelaide.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 29 Jul 1997 04:33:18 +0100 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Brian Somers stands accused of saying: > > Yep. I think I'll fix the usage message too - shouldn't it be: > > > > [[yy[mm[dd[hh]]]]mm[.ss]] > > That'd be consistent with the manpage. > > > > - The ability to input and output the timestamp in decimal or hex > > > localtime() format, ie. 0xXXXXXXXX or DDDDDDDDDD > > > > Do you mean to output the actual "number of seconds since the epoch", > > as in the opposite of the -r option ? > > -r emits seconds since the epoch in decimal. At the very least, -r > with a timevalue argument should set the time in seconds, preferably > using strtoul so that it can handle decimal, hex and octal. > > Actually, -r is redundant, as +%s will do the same thing. Not true. -r takes a ``seconds'' arg, and uses that instead of calling time(). It's a non-setting input value. I can get -r to use strtol(), but do we want to do things the other way too ? Do we want to be able to output hex too (ie, a change to strftime(3) - pity %x is gone...) ? > On further thought, an alternative approach would be to use the new > strptime() function and take a format string for scanning the time, > much as it takes now for formatting the output. This would allow us to change (say) the current month without touching the time..... how new is "strptime" ? It ain't on my machine (supped 1.5 hours ago). > -- > ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ > ]] Genesis Software genesis@gsoft.com.au [[ > ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ > ]] realtime instrument control. (ph) +61-8-8267-3493 [[ > ]] Unix hardware collector. "Where are your PEZ?" The Tick [[ -- Brian , Don't _EVER_ lose your sense of humour....