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


View this message in rfc822 format

From: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
To: Paul Eggert <eggert <at> CS.UCLA.EDU>
Cc: "6897 <at> debbugs.gnu.org" <6897 <at> debbugs.gnu.org>, Alan Curry <pacman-cu <at> kosh.dhis.org>, 李嘉鹏 <lijpbasin <at> 126.com>
Subject: bug#6897: date -d '1991-04-14 +1 day' fails
Date: Tue, 24 Aug 2010 11:22:24 +0200
On 08/24/10 10:04, Eggert, Paul wrote:

> On 08/24/10 00:23, Voelker, Bernhard wrote:
>
>> BTW: This example looks different here:
>> 
>>   $ TZ=Pacific/Kwajalein date -d 1993-08-20
>>   Sat Aug 21 00:00:00 MHT 1993
>> 
>>   $ date --version
>>   date (GNU coreutils) 8.5
>>   Packaged by Cygwin (8.5-2)
>>   ...
>> 
>> Why?
>
> Haven't a clue.  Perhaps you can debug it?  I get the
> correct answer (i.e., there was no such date) on both
> RHEL 5 with my own-built coreutils 8.5, and with
> Ubuntu 10.04 with its standard-issue coreutils 7.4.

Unfortunately, I'm currently quite busy.
I've sent a report to cygwin <at> cygwin.com:
http://cygwin.com/ml/cygwin/2010-08/msg00745.html


> Date arithmetic is pretty esoteric, after all.
> What is one month after 31 January, for example?

yes, sometimes it's not too important to care
about tomorrow ... but sometimes it is ;-)

> I'm becoming more inclined to say that GNU date
> shouldn't be doing date arithmetic at all.

I think it should - the point is that the base for
such date arithmetic must be valid. And since 1991-04-14
is a valid date in the OPs timezone, date should IMO
return the 15th for "1991-04-14 +1 day" - as Alan wrote.

Have a nice day,
Berny



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.