[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6897: date -d '1991-04-14 +1 day' fails
From: |
Paul Eggert |
Subject: |
bug#6897: date -d '1991-04-14 +1 day' fails |
Date: |
Mon, 23 Aug 2010 09:01:39 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 |
On 08/22/10 18:09, Alan Curry wrote:
> There might be less occurrences of this misunderstanding if we could teach
> date that -d 4/14/1991 is not actually a request for 4/14/1991 00:00:00, but
> "any time that existed during the day 4/14/1991", or perhaps a more specific
> "the first second of 4/14/1991".
>
> Has that been considered and rejected already, or is it just waiting for
> someone to implement it?
As far as I know nobody has ever suggested that, and it is a reasonable
suggestion.
However, it would not fix the problem in general, since in some cases there
is no "first second of date X", even when X is valid. For example:
$ TZ=Pacific/Kwajalein date -d 1993-08-20
date: invalid date `1993-08-20'
There was no time during the day 1993-08-20, because at midnight Kwajalein
moved the clocks ahead by 24 hours.
Perhaps the semantics could be "the first second whose time stamp is on
or after 1993-08-20 00:00:00", though then we'd have to deal with bug reports
from people on Kwajalein saying "wait a minute: I asked for August 20, but
it gave me August 21!".
Aren't dates fun?
- bug#6897: date -d '1991-04-14 +1 day' fails, 李嘉鹏, 2010/08/22
- bug#6897: date -d '1991-04-14 +1 day' fails, Bob Proulx, 2010/08/22
- bug#6897: date -d '1991-04-14 +1 day' fails, Alan Curry, 2010/08/22
- bug#6897: date -d '1991-04-14 +1 day' fails, Voelker, Bernhard, 2010/08/24
- bug#6897: date -d '1991-04-14 +1 day' fails, Paul Eggert, 2010/08/24
- bug#6897: date -d '1991-04-14 +1 day' fails, Voelker, Bernhard, 2010/08/24
- bug#6897: date -d '1991-04-14 +1 day' fails, Bob Proulx, 2010/08/24
- bug#6897: date -d '1991-04-14 +1 day' fails, Eric Blake, 2010/08/24
- bug#6897: date -d '1991-04-14 +1 day' fails, Voelker, Bernhard, 2010/08/24
bug#6897: date -d '1991-04-14 +1 day' fails, Bob Proulx, 2010/08/23