bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9718: bugs in `date` command?


From: Eric Blake
Subject: bug#9718: bugs in `date` command?
Date: Tue, 11 Oct 2011 07:59:40 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15

On 10/11/2011 01:31 AM, Voelker, Bernhard wrote:
Bryan Lee wrote:

The term "third wednesday" seems to be evaluating incorrectly.

glaive 12:24:56 [~]% date
Mon Oct 10 12:24:59 EDT 2011

glaive 12:24:59 [~]% date -d "first wednesday"
Wed Oct 12 00:00:00 EDT 2011

glaive 12:25:09 [~]% date -d "second  wednesday"
Wed Oct 12 00:00:01 EDT 2011

Indeed, this was parsed as "first wednesday + 1 second"

Thank you for the report, however I don't see what's wrong.
I guess you meant "second wednesday" - which you probably expected
to display Oct 19th?

As 'second' is already used for the time unit 'second', it cannot
be used as an ordinal number for 2nd.

As currently coded in the grammar, this is correct. But if someone were willing to put forth the effort to update parsedate.y, as well as enhance the testsuite to cover things, it might be possible to improve the grammar to accept both common meanings of "second" depending on the context where it appears compared to the rest of the date.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]