Subject: Re: bug#6897: date -d '1991-04-14 +1 day' fails

From: Bob Proulx <[email-masked]>
Date: Sun, 22 Aug 2010 18:12:45 -0600

李嘉鹏 wrote:

> I used some script(At the end of the letter) to get a series of
> date. but the script always fails at the date 1991-04-14. so I
> tested the single command
>     date -d '1991-04-14 +1 day'
> It would also fail with a error message
>     date: invalid date `1991-04-14 +1 day'
> displayed.

Thank you for the bug report.  However I am unable to reproduce it.
Therefore I conclude that the problem must be related to your
timezone.  Because you are taking dates a midnight I am guessing that
there is very likely a daylight savings time issue there.  (Was
Daylight Savings Time active then?)  Instead, try looking at dates at
noon.

  date -d '1991-04-14 12:00 +1 day'

> I'm from china by the way, and the time zone I am in and to which
> the systems were set is GMT8(or CST, China Standard Time).

I am sorry that I am not familiar with those timezones.  What is the
time there that would allow me to recreated it on my system?  Either
for a TZ variable setting or a setting for /etc/localtime?  For
example either TZ=Americas/Denver or TZ=US/Mountain would configure my
personal timezone.

>  I've not looked at any "Known Bugs" list because I didn't find
>  one. If the problem happens to appear on the list.Would you please
>  send me one.

Please review the FAQ for date.

  http://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-working-right_002e

Bob