[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wrong Year given by %G (and %g)
From: |
Bob Proulx |
Subject: |
Re: Wrong Year given by %G (and %g) |
Date: |
Mon, 29 Dec 2003 10:09:49 -0700 |
User-agent: |
Mutt/1.3.28i |
Carlo Wood wrote:
> At this time
>
> >date
> Mon Dec 29 02:23:36 CET 2003
Running cal today says:
December 2003
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
So Thursday starts the new year. This week contains that first week.
This is now week number one of 2004?
date +%V
01
This is the first week of the new year.
%G the 4-digit year corresponding to the %V week number
> %G format gives the year 2004:
>
> >date +%G
> 2004
Seems good so far. Week number 1 in 2004.
> It didn't do so yesterday.
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