End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
DateTime#zone
d.zone → string
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_zone(VALUE self)
{
get_d1(self);
return m_zone(dat);
}
Returns the timezone.
Example
DateTime.parse('04pm+0730').zone #=> "+07:30"