bugGNU Core Utilities - Bugs: bug #18921, Date Issues

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18921: Date Issues

Submitter:  Clint <cpriest>
Submitted:  Thu 01 Feb 2007 01:27:25 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Thu 01 Feb 2007 03:06:10 AM UTC, comment #1: 

This is the correct database, but it is not a bug, just an artifact of the screwy way that humans track time.  The GNU date documentation is explicit that -1 month operates only on the month field without regards to how many days are in a month, so '31 July -1 month' = '31 June'.  But June does not have 31 days, we have to guess whether June 30 or July 1 was intended.  No matter which way we guess, someone will complain we guessed wrong.  So you are stuck with the current behavior; if all you need is the month changed, then calculate 'July -1 month' independently of the day (and consider a day around the 15th of the month).  A similar fuzzy boundary exists around daylight savings boundaries.

Eric Blake <ericb>
Group administrator
Thu 01 Feb 2007 01:27:25 AM UTC, original submission:  

I'm unsure if this is the correct bug database to post this to.  The bug is shown in PHP however the PHP developers have referred me to the GNU Date code as that's what PHP uses.

[esp ~]$ date --date='31 July 2001 -1 month'

Expected Result:
Sat Jun  30 00:00:00 CEST 2001

Actual Result:
Sun Jul  1 00:00:00 CEST 2001

[esp ~]$ date --date='1/31/07 +1 month'

Expected Result:
Wed Feb 28 00:00:00 PST 2007

Actual Result:
Sat Mar  3 00:00:00 PST 2007

Clint <cpriest>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by cpriest (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-01 ericb StatusNone Invalid
        Open/ClosedOpen Closed
    2007-02-01 cpriest Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code