Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 1997 04:33:18 +0100
From:      Brian Somers <brian@awfulhak.org>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        brian@awfulhak.org (Brian Somers), freebsd-hackers@FreeBSD.ORG
Subject:   Re: date(1) 
Message-ID:  <199707290333.EAA20583@awfulhak.org>
In-Reply-To: Your message of "Tue, 29 Jul 1997 12:41:47 %2B0930." <199707290311.MAA09780@genesis.atrad.adelaide.edu.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <brian@awfulhak.org>, <brian@freebsd.org>
      <http://www.awfulhak.org>;
Don't _EVER_ lose your sense of humour....





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