On Mon, 31 Jul 2006, Vladislav ZItikis wrote:
I think, I find a bug in date calculations.
This is example for demonstration:
-----------------------------------------------------------
[EMAIL PROTECTED] date
Mon Jul 31 17:12:57 MSD 2006
[EMAIL PROTECTED] date -d "1 month ago" +"%m"
07
[EMAIL PROTECTED] date -d "2 month ago" +"%m"
05
[EMAIL PROTECTED]
------------------------------------------------------------------
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
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils