End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Date#cwyear
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 commercial-date year for self (see Date.commercial):
Example
Date.new(2001, 2, 3).cwyear # => 2001 Date.new(2000, 1, 1).cwyear # => 1999