Hello,

The Time class does not have any method to retreive the week number. The only way I found is to use strftime and convert the result to integer. Is there a better way?

class Time
  def week
    strftime("%U").to_i
  end
end

Should such a method be part of the built-in classes?
If yes, we have to deal with the two formats of week numbers. The week method could call week_starting_on_monday or week_starting_on_sunday, depending on system config overridable with a global variable?


Mike.
midulo.