How do I get the week number ISO from Ruby?

[code type=ruby]$ Date.parse(“2015-12-31”).strftime(“%W”)

Result: 52
[code type=ruby]$ Date.parse(“2015-12-31”).cweek

Result: 53

http://stackoverflow.com/questions/13075617/rails-3-2-8-how-do-i-get-the-week-number-from-rails

Share and Enjoy !

0Shares
0 0