GNU bug report logs - #6897
date -d '1991-04-14 +1 day' fails

Previous Next

Package: coreutils;

Reported by: 李嘉鹏 <lijpbasin <at> 126.com>

Date: Sun, 22 Aug 2010 19:33:02 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #28 received at 6897 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Alan Curry <pacman-cu <at> kosh.dhis.org>
Cc: 6897 <at> debbugs.gnu.org
Subject: Re: bug#6897: date -d '1991-04-14 +1 day' fails
Date: Mon, 23 Aug 2010 15:26:05 -0700
On 08/23/2010 02:59 PM, Alan Curry wrote:
> date: invalid date `4/14/1991'
>
> which is a lie. 4/14/1991 is not an invalid date.

It is an invalid date, under the assumption
that dates without times refer to the time 00:00:00
on that date.  This assumption has been in the software
for ages, and explains, for example, why
"date -d '2010-01-01 25 hours'" reports 01:00 the
next day.  No doubt this could all be better documented,
but there's nothing unreasonable per se about the
assumption.

> Bonus thought: the "date" command is misnamed.

"time" was taken.  At this late date (:-) it's not
likely that the names will be changed.




This bug report was last modified 14 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.