On Thu, Apr 4, 2019 at 11:05 PM Brett Milford <xxxxxx@gmail.com> wrote:

I'd just like to clarify the date->string conversion characters in Table 1 of https://srfi.schemers.org/srfi-19/srfi-19.html

This is just a mess. The correct range of ISO week numbers is  01..53.  There is no week 00, and years may have either 52 or 53 weeks; the 53rd week is partial.  What is more, ISO weeks start on Monday (that's why Saturday and Sunday are "the week end").
~U | week number of year with Sunday as first day of week (00...53) # should be 00..51 ?
~V | week number of year with Monday as first day of week (01...52) # should be 'Sunday'
~W | week number of year with Monday as first day of week (01...52)
~x | week number of year with Monday as first day of week (00...53) # should also be 51?
Presumably all this is intended to allow non-ISO week numbers of 00..52 and non-ISO weeks that begin on Sunday, a habit of thought specific to Australia, Canada, and the U.S. These countries start their weeks on Sunday, and even that is mostly for wall art calendars; (paper) work calendars generally start on Monday.  (Of course, Jewish and Seventh Day Adventist religious calendars start on Sunday so that Saturday is "the seventh day".)

Here are the relevant strftime() directives:

       %u     The day of the week as a decimal, range 1 to 7, Monday being 1.
              See also %w.  (Calculated from tm_wday.)  (SU)

       %V     The ISO 8601 week number (see NOTES) of the current year as a
              decimal number, range 01 to 53, where week 1 is the first week
              that has at least 4 days in the new year.  See also %U and %W.
              (Calculated from tm_year, tm_yday, and tm_wday.)  (SU)

       %w     The day of the week as a decimal, range 0 to 6, Sunday being
              0.  See also %u.  (Calculated from tm_wday.)

       %W     The week number of the current year as a decimal number, range
              00 to 53, starting with the first Monday as the first day of
              week 01.  (Calculated from tm_yday and tm_wday.)

Here's the explanation of ISO weeks given on the strftime() man page:

       In this system, weeks start on a
       Monday, and are numbered from 01, for the first week, up to 52 or 53,
       for the last week.  Week 1 is the first week where four or more days
       fall within the new year (or, synonymously, week 01 is: 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.
       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 (%V) of the year
       2009 (%G); week 01 of ISO 8601 year 2010 starts on Monday, 4 January
       2010.