On Tue, 10 Apr 2007, paul at clubi.ie wrote:
> If so, you can apparently adjust the time used in these relative
> time modifications, so something like:
>> "0800 today 3 weeks ago"
>> /might/ avoid that problem..
Also, the coreutils manual mentions a solution to a similar boundary
problem with months:
The fuzz in units can cause problems with relative items. For
example, 2003-07-31 -1 month might evaluate to 2003-07-01, because
2003-06-31 is an invalid date. To determine the previous month more
reliably, you can ask for the month before the 15th of the current
month. For example:
$ date -R
Thu, 31 Jul 2003 13:02:39 -0700
$ date --date='-1 month' +'Last month was %B?'
Last month was July?
$ date --date="$(date +%Y-%m-15) -1 month" +'Last month was %B!'
Last month was June!
regards,
--
Paul Jakma paul at clubi.iepaul at jakma.org Key ID: 64A2FF6A
Fortune:
Karl's version of Parkinson's Law: Work expands to exceed the time alloted it.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!