Ruby | Date cwyear() function
Date#cwyear() is a Date class method which returns the calendar week based year. Syntax: Date.cwyear() Parameter: Date values Return: the calendar week based year. Example #1 : Ruby 1=1 # Ruby code for Date.cwyear() method # loading date require 'date' # declaring Date a = Date.new(2019, 1, 1) # dec