bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in date utillity


From: Philip Rowlands
Subject: Re: bug in date utillity
Date: Mon, 31 Jul 2006 14:36:42 +0100 (BST)

On Mon, 31 Jul 2006, Vladislav ZItikis wrote:

I think, I find a bug in date calculations.
This is example for demonstration:
-----------------------------------------------------------

address@hidden date
Mon Jul 31 17:12:57 MSD 2006

address@hidden date -d "1 month ago" +"%m"
07
address@hidden date -d "2 month ago" +"%m"
05
address@hidden

------------------------------------------------------------------
I think, date -d "1 month ago" +"%m" must return to me '06' but not '07'

Please see section 27.6 of the date manual, "Relative items in date strings", which states:

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.


Cheers,
Phil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]