Skip to contentSkip to conversation

strftime.3: ISO week number can be 52, add example

PATCH In review Urs Thuermann 2 participants 2 messages Nov 2, 2009 – Apr 14, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 strftime.3: ISO week number can be 52, add example

A year cannot only begin with week number 53 of the previous year but also with week number 52. Year 2011 is an example for this case, as can be easily seen with GNU date:

$ date -d "jan 1 2011" "+%c %V %G"
Sat Jan  1 00:00:00 2011 52 2010

This patch is against the current man-pages git repository.

urs

man3/strftime.3 +4 -2
index 8dfe58c..a516979 100644
@@ -360,13 +360,15 @@ the first week of the year that contains a Thursday;
 or, the week that has 4 January in it).
 When three of fewer days of the first calendar week of the new year fall
 within that year,
-then the ISO 8601 week-based system counts those days as part of week 53
-of the preceding year.
+then the ISO 8601 week-based system counts those days as part of week 52
+or 53 of the preceding year.
 For example, 1 January 2010 is a Friday,
 meaning that just three days of that calendar week fall in 2010.
 Thus, the ISO\ 8601 week-based system considers these days to be part of
 week 53 (\fB%V\fP) of the year 2009 (\fB%G\fP) ;
 week 01 of ISO\ 8601 year 2010 starts on Monday, 4 January 2010.
+Similarly, the first two days of January 2011 are considered to be part
+of week 52 of the year 2010.
 .SS Glibc Notes
 Glibc provides some extensions for conversion specifications.
 (These extensions are not specified in POSIX.1-2001, but a few other

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

Hello Urs,

Quoted 9 lines · Urs Thuermann

A year cannot only begin with week number 53 of the previous year but also with week number 52. Year 2011 is an example for this case, as can be easily seen with GNU date:

$ date -d "jan 1 2011" "+%c %V %G"
Sat Jan  1 00:00:00 2011 52 2010

This patch is against the current man-pages git repository.

Patch applied!

Cheers,

Michael

Quoted 22 lines
man3/strftime.3 +4 -2
index 8dfe58c..a516979 100644
@@ -360,13 +360,15 @@ the first week of the year that contains a Thursday;
 or, the week that has 4 January in it).
 When three of fewer days of the first calendar week of the new year fall
 within that year,
-then the ISO 8601 week-based system counts those days as part of week 53
-of the preceding year.
+then the ISO 8601 week-based system counts those days as part of week 52
+or 53 of the preceding year.
 For example, 1 January 2010 is a Friday,
 meaning that just three days of that calendar week fall in 2010.
 Thus, the ISO\ 8601 week-based system considers these days to be part of
 week 53 (\fB%V\fP) of the year 2009 (\fB%G\fP) ;
 week 01 of ISO\ 8601 year 2010 starts on Monday, 4 January 2010.
+Similarly, the first two days of January 2011 are considered to be part
+of week 52 of the year 2010.
 .SS Glibc Notes
 Glibc provides some extensions for conversion specifications.
 (These extensions are not specified in POSIX.1-2001, but a few other
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/