As you've displayed, the newer 'test' version behaves correctly.
Has this already been released? I suppose I can directly replace
the 'date' utility on my system but do I want to just install
eerything from this source package?
On Sun, Sep 03, 2000 at 08:31:34PM +0200, Jim Meyering wrote:
> Thanks for the report.
> I can't reproduce it using the latest test release on any of
> the systems I've tried. I always get this:
>
> $ date +%w --date "jan 1 2000"
> 6
> $ date +%w --date "jan 1 2001"
> 1
>
> Would you please see if you can reproduce that
> problem using the latest test release?
>
> ftp://alpha.gnu.org/gnu/fetish/sh-utils-2.0j.tar.gz
>
> Sue Bauer-Lee <[EMAIL PROTECTED]> writes:
> | [pooh doc]$ date --version
> | date (GNU sh-utils) 2.0
> | Written by David MacKenzie.
> |
> | Above as included with RedHat v6.2 distribution. I just ran across
> | something interesting I thought maybe someone could help me with. I
> | checked the man page, and info page but have been unable to find any
> | additional references.
> |
> | I've written a shell script that determines the 2nd Thurs of the next
> | month (so I can email meeting notices in a timely fashion). My calculations
> | work great, for the current year. where I ran into a problem was when
> | asking 'date' to return information based on a 'specified' year.
> |
> | The least complicated examples:
> | I started my test here since I wanted to make sure that the script
> | would work properly going into next year so I tested the following:
> |
> | [pooh doc]$ date +%w --date "jan 1 2001"
> | 6
> | The first day of Jan is a Saturday for the year 2000. Wrong answer.
> |
> | [pooh doc]$ date +%w --date "jan 1 2000"
> | 6
> | Obviously correct.
> |
> | [pooh doc]$ date +%w --date "jan 1 next year"
> | 1
> | Correct. Expected this when specifying '2001'.
> |
> | [pooh doc]$ date +%w --date "jan 1 this year"
> | 1
> | We don't recognize 'this year' correctly?
> |
> | [pooh doc]$ date +%w --date "jan 1 "
> | 6
> | Current year assumed.
-----------------------------------------------------
Sue Bauer-Lee | KE4HNN
PO Box 2900 |
Lilburn, GA 30048 | Email: [EMAIL PROTECTED]
-----------------------------------------------------