Re: [PATCH 1/2] Add date formatting and parsing functions relative to a given time
- From
Jeff King <peff@peff.net>
- Date
- Aug 30, 2009, 10:08 UTC
- Message-ID
- <20090830100826.GA31543@coredump.intra.peff.net>
- In-Reply-To
- <81b0412b0908300256l13d308d9oc30172a20a9f6108@mail.gmail.com>
On Sun, Aug 30, 2009 at 11:56:37AM +0200, Alex Riesen wrote:
Show 13 quoted lines
> > +check_show 5 '5 seconds ago' > > +check_show 300 '5 minutes ago' > > +check_show 18000 '5 hours ago' > > +check_show 432000 '5 days ago' > > +check_show 1728000 '3 weeks ago' > > +check_show 13000000 '5 months ago' > > +check_show 37500000 '1 year, 2 months ago' > > +check_show 55188000 '1 year, 9 months ago' > > +check_show 630000000 '20 years ago' > > check_show 630000000 '20.years.ago'? > (Arbitrary, non-whitespace delimiters, which was an > advertised feature, to make shell's life easier)
This part is about checking what show_date produces (the first number is an offset from now in seconds, and the second is what we expect), so it always has spaces.
See the check_approxidate section further down for an example of parsing what you are talking about.
-Peff