[ILUG] Update on the Gnu date problem

paul at clubi.ie paul at clubi.ie
Tue Apr 10 15:33:55 IST 2007


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.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
Karl's version of Parkinson's Law:  Work expands to exceed the time alloted it.



More information about the ILUG mailing list