[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9718: bugs in `date` command?
From: |
Voelker, Bernhard |
Subject: |
bug#9718: bugs in `date` command? |
Date: |
Tue, 11 Oct 2011 09:31:00 +0200 |
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
>
> glaive 12:25:16 [~]% date -d "third wednesday"
> Wed Oct 26 00:00:00 EDT 2011
>
> glaive 12:25:21 [~]% date -d "fourth wednesday"
> Wed Nov 2 00:00:00 EDT 2011
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. The info text clarifies this
(info coreutils 'date invocation'):
A few ordinal numbers may be written out in words in some contexts.
This is most useful for specifying day of the week items or relative
items (see below). Among the most commonly used ordinal numbers, the
word `last' stands for -1, `this' stands for 0, and `first' and `next'
both stand for 1. Because the word `second' stands for the unit of
time there is no way to write the ordinal number 2, but for convenience
`third' stands for 3, `fourth' for 4, `fifth' for 5, `sixth' for 6,
`seventh' for 7, `eighth' for 8, `ninth' for 9, `tenth' for 10,
`eleventh' for 11 and `twelfth' for 12.
Did you mean this?
Have a nice day,
Berny