bug-coreutils
[Top][All Lists]
Advanced

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

[bug #19475] date produces incorrect output with +/-1 Month when the dat


From: Eric Blake
Subject: [bug #19475] date produces incorrect output with +/-1 Month when the date is the 31st
Date: Sat, 31 Mar 2007 23:10:25 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 Mnenhy/0.7.5.666

Update of bug #19475 (project coreutils):

                  Status:                    None => Duplicate              
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Not a bug; but it is a duplicate of bug #18921.  The manual specifically
recommends the following (info coreutils relative):

   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!


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?19475>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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