The API dock states:
%U - Week number of the year. The week starts with Sunday. (00..53)
%W - Week number of the year. The week starts with Monday. (00..53)
ISO 8601 states that the first week of the year is the week that contains that year's first Thursday.
2013 starts on a Tuesday. Thus week 1 is that which starts with December 31, 2012 as week 1 (for %W)
Code:
my_date_variable.strftime("%W").to_i
is returning week # 1 as that starting January 7, 2013. Does not match what ISO 8601 would do.