GNU bug report logs - #10699
bug of `date`: why 1/1/2012 is the second week of 2012?

Previous Next

Package: coreutils;

Reported by: "Wang, YuanTao" <ytwang <at> freewheel.tv>

Date: Thu, 2 Feb 2012 17:06:02 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#10699: closed (bug of `date`: why 1/1/2012 is the second week
 of 2012?)
Date: Thu, 02 Feb 2012 18:32:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 02 Feb 2012 10:30:53 -0800
with message-id <4F2AD65D.6010102 <at> cs.ucla.edu>
and subject line Re: bug#10699: bug of `date`: why 1/1/2012 is the second week of 2012?
has caused the debbugs.gnu.org bug report #10699,
regarding bug of `date`: why 1/1/2012 is the second week of 2012?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
10699: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10699
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Wang, YuanTao" <ytwang <at> freewheel.tv>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: bug of `date`: why 1/1/2012 is the second week of 2012?
Date: Thu, 2 Feb 2012 02:25:59 -0600
[Message part 3 (text/plain, inline)]
$ 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?

$ uname -r
2.6.18-128.1.6.el5xen

[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Wang, YuanTao" <ytwang <at> freewheel.tv>
Cc: 10699-done <at> debbugs.gnu.org
Subject: Re: bug#10699: bug of `date`: why 1/1/2012 is the second week of 2012?
Date: Thu, 02 Feb 2012 10:30:53 -0800
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.


This bug report was last modified 13 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.