Paul Eggert wrote:

Steve Cousins <[EMAIL PROTECTED]> writes:

date Versions 5.96 and 5.97 (at least) have a bug when passing dates
that are greater than the actual number of days in a month.  Previous
versions (most of the machines seem to have 5.2.1) would convert the
date to a correct date.

The change was advertised as a "new feature" in NEWS:

   Dates like `January 32' with out-of-range components are now rejected.
Hi Paul,

Thanks for the reply.

Don't I love new "features" like this?! What is the purpose of this? I guess I'll look it up. ... It looks like there was no discussion. Just a quick statement. How is it more useful to report an error rather than doing a meaningful conversion?

   date -d"20060201 - 1 day"

does not work.  It reports Feb 2.

Try this:

  date -u -d"2006-02-01 -1 day"


Well, by putting in the hyphens it does work. The -u (at least in this example) doesn't seem to do anything. However, doing:

date.5.96 -u -d"20060201 -1 day"
reports

   date.5.96: invalid date `20060201 -1 day'

whereas:

   date.5.2.1 -u -d"20060201 - 1 day"

reports

   Thu Feb  2 00:00:00 UTC 2006

Which is wrong but it at least tries to deal with dates in the form YYYYMMDD. Is this a bug or a feature?
Thanks,

Steve


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to