[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10699: bug of `date`: why 1/1/2012 is the second week of 2012?
From: |
Paul Eggert |
Subject: |
bug#10699: bug of `date`: why 1/1/2012 is the second week of 2012? |
Date: |
Thu, 02 Feb 2012 10:30:53 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
On 02/02/2012 12:25 AM, Wang, YuanTao wrote:
> $ date -d "2012-01-01 00:00:00" +%U
> 01
>
> but in "man date"
> %U week number of year, with Sunday as first day of week (00..53)
>
> Is it a bug?
No. As the manual (which has more detail) says,
"Days in a new year preceding the first Sunday are in week zero."
In 2012 there are no such days, so January 1 is week 1.