Question: I would like to know how to get the current week number from Rails and how do I manipulate it: 

1. Translate the week number into date.
2. Make an interval based on week number.

Thanks.

Answer: 
```
date.commercial([cwyear=-4712[, cweek=1[, cwday=1[, start=Date::ITALY]]]]) → date
Creates a date object denoting the given week date.

The week and the day of week should be a negative 
or a positive number (as a relative week/day from the end of year/week when negative). 
They should not be zero.

```

For the interval

```
require 'date'

  def week_dates( week_num )
    year = Time.now.year
    week_start = Date.commercial( year, week_num, 1 )
    week_end = Date.commercial( year, week_num, 7 )
    week_start.strftime( "%m/%d/%y" ) + ' - ' + week_end.strftime("%m/%d/%y" )
  end

  puts week_dates(22)

```

> 
> EG: Input (Week Number): 22
> 
> 
> Output: 06/12/08 - 06/19/08
> 
> 
> 

credit: Siep Korteling <http://www.ruby-forum.com/topic/125140>
[`Date#cweek`](http://ruby-doc.org/stdlib-2.2.2/libdoc/date/rdoc/Date.html#method-i-cweek) seems to get the ISO-8601 week number (a Monday-based week) like `%V` in strftime (mentioned by @Robban in a comment).

For example, the Monday and the Sunday of the week I'm writing this:

```
[ Date.new(2015, 7, 13), Date.new(2015, 7, 19) ].map { |date|
  date.strftime("U: %U - W: %W - V: %V - cweek: #{date.cweek}")
}

# => ["U: 28 - W: 28 - V: 29 - cweek: 29", "U: 29 - W: 28 - V: 29 - cweek: 29"]

```