Week numbers in Ruby
To get the current ISO 8601 week number in Ruby, use the following code snippet:
require "date"
puts Date.today.cweek
* Ensure your system or application regional settings are set to follow ISO 8601 standards (weeks start on Monday) if the output varies.