week number definition for Linux ?
I have a question about how week number should be defined/counted (in Linux) in terms of week number of a year and week number of a month.
For instance, 2011-01-07:
It is in the week 1 of the year 2011 which obtained by using
Su Mo Tu We Th Fr Sa
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
and printf the value of %U of the given struct tm for 2011-01-07 .
size_t strftime ( char * ptr, size_t maxsize, const char * format, const struct tm * timeptr );
However, I am not sure 2011-01-07 is considered to be in the week #1 or week #2 of the month. What would be the right value?
I need to know the correct week number of the month because it will be used to set TZ env as CST+6CDT,M4.1.0/2,M10.5.0/2 for daylight saving time. and the number in Bold above is the week number in month needed to be specified.
Could you kindly offer your comments on this.
Thanks in advance. :-)