"Sebastien ESTIENNE" <[EMAIL PROTECTED]> writes:

> on 7 juanary 2004 when i ask date to print the week number of the year 7
> days ago, normaly the last day of the previous year, 'date' answers 01 so
> date -d "7 days ago" '+%V'
> and
> date -d "7 days ago" '+%V'
> give the same answer!!!

Of course they do, the commands are identical.  Did you mean "6 days ago"
in the second case?

> example:
> [EMAIL PROTECTED] sebest $ date
> Wed Jan  7 17:04:02 CET 2004
> [EMAIL PROTECTED] sebest $ date -d "7 days ago" '+%Y-%V'
> 2003-01
> [EMAIL PROTECTED] sebest $ date -d "7 days ago" '+%Y-%U'
> 2003-52
> [EMAIL PROTECTED] sebest $ date -d "6 days ago" '+%Y-%V'
> 2004-01
> [EMAIL PROTECTED] sebest $

Perfectly correct.

`%V'
     week number of year with Monday as first day of the week as a
     decimal (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.)

$ date -d "8 days ago" '+%G-%V'
2004-01

`%G'
     The year corresponding to the ISO week number.  This has the same
     format and value as `%Y', except that if the ISO week number (see
     `%V') belongs to the previous or next year, that year is used
     instead.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux AG, Maxfeldstra�e 5, 90409 N�rnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to