date "+%j" bug?

"Timothy J. Luoma" <[email protected]> Wed, 26 Jun 2002 22:23:20 -0400 (Eastern Daylight Time)
Newsgroups gmane.comp.gnu.sh-utils.bugs
Message-ID <Pine.WNT.4.44.0206262217210.4060-100000@Tim>
I was testing out:

  %j   day of year (001..366)

Since I can't run the test once per day (need it before that ;-) I was
using the --date field.

Since feb 29 is obviously the trick here, I tried:

$ date --date "02/28" "+%j"
059
(ok, good, that makes sense)

$ date --date "02/29" "+%j"
060
(ok, that makes sense too)

$ date --date "03/01" "+%j"
060
(oh no)

A little testing showed that if I set the year to be leap year, then it
would work as expected.

Is this the expected behavior?

Thanks
TjL