bugGNU Core Utilities - Bugs: bug #11687, GNU date doesn't discriminate...

 
 

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

bug #11687: GNU date doesn't discriminate between + and - in relative dates.

Submitter:  Ingvar Mattsson <ingvar>
Submitted:  Fri 21 Jan 2005 07:22:35 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Fri 21 Jan 2005 11:43:13 PM UTC, comment #1: 

The sign bug appears to be fixed in coreutils 5.3.0:

   $ date; date -d "1715 - 15 minutes"; date -d "1715 + 15 minutes"; date -d "1715 + 15 minutes ago"; date -d "1715 - 15 minutes ago"; date -d "- 1 month"; date; date --version
   Fri Jan 21 15:33:47 PST 2005
   date: invalid date `1715 - 15 minutes'
   date: invalid date `1715 + 15 minutes'
   date: invalid date `1715 + 15 minutes ago'
   date: invalid date `1715 - 15 minutes ago'
   Tue Dec 21 15:33:47 PST 2004
   Fri Jan 21 15:33:47 PST 2005
   date (GNU coreutils) 5.3.0
   Written by David MacKenzie.

   Copyright (C) 2005 Free Software Foundation, Inc.
   This is free software; see the source for copying conditions.  There is NO
   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As you can see, a few other parsing details have changed,
due to the ambiguity between time zone indications and
the offset notation; but at least `date -d "- 1 month"'
works.

Paul Eggert <eggert>
Group administrator
Fri 21 Jan 2005 07:22:35 PM UTC, original submission:  

GNU date doesn't discriminate between + and - in relative dates. This may well affect all GNU coreutils using the same date parsing library.

Example:
head$ date --version
date (coreutils) 5.2.1
Written by David MacKenzie.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
head$ date
Fri Jan  7 07:10:43 GMT 2005
head$ date -d "1715 - 15 minutes"
Fri Jan  7 17:30:00 GMT 2005
head$ date -d "1715 + 15 minutes"
Fri Jan  7 17:30:00 GMT 2005
head$ date -d "1715 + 15 minutes ago"
Fri Jan  7 17:00:00 GMT 2005
head$ date -d "1715 - 15 minutes ago"
Fri Jan  7 17:00:00 GMT 2005
head$ date -d "- 1 month"
Mon Feb  7 07:10:36 GMT 2005


[ NB, this bug was delayed, due to a submission to the Debian bug tracking system,
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=289103
]

Ingvar Mattsson <ingvar>

 

(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

 

CC list is empty

 

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 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-01-21 eggert StatusNone Fixed
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code