-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to bernard on 11/29/2006 8:07 PM:
> The year 2006 started on Sunday.  This week, according to man page,
> "date +%U" should return "48" (week of year with Sunday being first day
> of the week).  However, "date +%W" and "date +%V" should both return
> "49" (week of year with Monday being first day of the week).
> 
> All three are returning "48", and it is a problem.  What am I missing?

Thanks for the report, however, this is not a bug.  Read 'info date' for
more details (which in turn come from the POSIX rules):

`%U'
     week number of year, with Sunday as the first day of the week
     (`00'...`53').  Days in a new year preceding the first Sunday are
     in week zero.

`%V'
     ISO week number, that is, the week number of year, with Monday as
     the first day of the week (`01'...`53').  If the week containing
     January 1 has four or more days in the new year, then it is
     considered week 1; otherwise, it is week 53 of the previous year,
     and the next week is week 1.  (See the ISO 8601 standard.)

`%W'
     week number of year, with Monday as first day of week
     (`00'...`53').  Days in a new year preceding the first Monday are
     in week zero.

In other words, according to each set of rules, Jan 2 (Monday) belongs to
week 1.

- --
Life is short - so eat dessert first!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFblLo84KuGfSFAYARAvzwAJ9LhgiPPtfx7EtY+N7mIAoLlLgVVwCfcqog
cnliofZlhxwckxdvbaScTl4=
=Eufi
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to