On Thu, Jul 16, 2020 at 03:43:24PM +0000, Thorsten Glaser wrote:
> Michael Meskes dixit:
>
> >Do you have any documentation about the US system that is kind of
> >official? I doubt anyone in the States uses week numbers, but there may
> >be an official way nonetheless.
>
> https://de.wikipedia.org/wiki/Woche#Berechnung_in_den_USA_und_vielen_anderen_L%C3%A4ndern
Oh right, the German version knows how it's done in the States but the English
one doesn't. Please excuse me if I don't really accept this as fact,
particularly as the page itself claims that the information is not verifiable
and needs references.
> Also as an example:
>
> $ kwal -mw 1 2005
> January 2005
> Mo Tu We Th Fr Sa Su
> 1 2 [53]
> 3 4 5 6 7 8 9 [ 1]
> 10 11 12 13 14 15 16 [ 2]
> 17 18 19 20 21 22 23 [ 3]
> 24 25 26 27 28 29 30 [ 4]
> 31 [ 5]
> $ kwal -w 1 2005
> January 2005
> Su Mo Tu We Th Fr Sa
> 1 [ 1]
> 2 3 4 5 6 7 8 [ 2]
> 9 10 11 12 13 14 15 [ 3]
> 16 17 18 19 20 21 22 [ 4]
> 23 24 25 26 27 28 29 [ 5]
> 30 31 [ 6]
> $ ncal -w 1 2005
> January 2005
> Su 2 9 16 23 30
> Mo 3 10 17 24 31
> Tu 4 11 18 25
> We 5 12 19 26
> Th 6 13 20 27
> Fr 7 14 21 28
> Sa 1 8 15 22 29
> 52 1 2 3 4 5
>
> The first one is correct for Germany. The second one is correct for USA
> according to that documentation above. The third… whatever it is, is what
> ncal does.
Unfortunately you didn't tell us which locale you ran it under, but anyway,
let's have a look:
$ export LC_ALL=de_DE.UTF8; ncal -bw 1 2005
Januar 2005
w| Mo Di Mi Do Fr Sa So
53| 1 2
1| 3 4 5 6 7 8 9
2| 10 11 12 13 14 15 16
3| 17 18 19 20 21 22 23
4| 24 25 26 27 28 29 30
5| 31
Except for formatting changes this is exactly your case 1, right?
As for the second, see above. Unless proven wrong I stick with what the locale
gives me.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De
Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org