End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Date#cwyear
d.cwyear → integer
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_cwyear(VALUE self)
{
get_d1(self);
return m_real_cwyear(dat);
}
Returns the calendar week based year.
Example
Date.new(2001,2,3).cwyear #=> 2001 Date.new(2000,1,1).cwyear #=> 1999