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

Submitted by:  Clint <cpriest>
Submitted on:  Thu 01 Feb 2007 01:27:25 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned 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>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 01 Feb 2007 03:06:10 AM UTCericbStatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Thu 01 Feb 2007 01:27:26 AM UTCcpriestCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1