[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem using 'date' coreutil
From: |
Eric Blake |
Subject: |
Re: problem using 'date' coreutil |
Date: |
Wed, 29 Nov 2006 20:41:28 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666 |
-----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 address@hidden
-----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-----