Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 130503

Summary: /bin/date broken when using 'ago'
Product: Gentoo Linux Reporter: flobber <flobber>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED INVALID    
Severity: major CC: f5d8fd51ed1e804c9e8d0357e8614e0493b06e96
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description flobber 2006-04-19 11:38:20 UTC
The command

  date -d '1 hour ago'

works, but

  date - d '1 hour 1 minutes ago'

does not, the "ago" is ignored.

Earlier versions of date didn't have this bug.

Broken version:
  date (GNU coreutils) 5.94
Comment 1 SpanKY gentoo-dev 2006-04-19 11:53:52 UTC
you need to do `date -d '1 hour ago 1 minute ago'`
Comment 2 flobber 2006-04-19 12:17:46 UTC
(In reply to comment #1)
> you need to do `date -d '1 hour ago 1 minute ago'`

For at least the last 10 years '1 hour 1 minute ago' was
taken as -61 minutes not +59 minutes.  I have a couple of
scripts that broke due to this BUG.
Comment 3 flobber 2006-04-19 12:31:40 UTC
Just for the record, the oldest GNU date I have available is 1.16
from 1997 and it takes it as -61 minutes as does 5.3.0 from 2005.

And the notation of '1 hour ago 1 minute ago' is interpreted
by those versions as '(((1 hour) ago) 1 minute) ago' giving
+59 minutes.  So this syntax is not even backwards compatible.
Comment 4 SpanKY gentoo-dev 2006-04-20 06:02:52 UTC
the documentation suggests the new behavior is correct (confirmed with upstream)

if you still feel this is a bug, talk with upstream
http://lists.gnu.org/mailman/listinfo/bug-coreutils