bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong Year given by %G (and %g)


From: Steven Augart
Subject: Re: Wrong Year given by %G (and %g)
Date: Mon, 29 Dec 2003 16:32:38 -0500

Yes, exactly.   This is officially defined in ISO 8601:1988 and 
subsequently used by POSIX.2-1922 and by ISO C '99.
I quote from the GNU C Library manual:

          ISO weeks start with Monday and end with
          Sunday.  Week `01' of a year is the first week which has the
          majority of its days in that year; this is equivalent to the
          week containing the year's first Thursday, and it is also
          equivalent to the week containing January 4.  Week `01' of a
          year can contain days from the previous year.  The week
          before week `01' of a year is the last week (`52' or `53') of
          the previous year even if it contains days from the new year.

--Steven Augart





address@hidden (Bob Proulx)
Sent by: address@hidden
12/29/2003 12:09 PM
 
        To:     Carlo Wood <address@hidden>
        cc:     address@hidden
        Subject:        Re: Wrong Year given by %G (and %g)

[...]
I don't know the definition but it apears that the week starts on
Monday.

  date --date='28 Dec 2003' +%V
  52

  date --date='29 Dec 2003' +%V
  01

Since it is a "work week" usage that makes perfect sense to me.  Work
weeks start on Monday to most industry.

Bob


reply via email to

[Prev in Thread] Current Thread [Next in Thread]