Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
DateTime#offset
() -> ::Rational
d.offset → rational
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_offset(VALUE self)
{
get_d1(self);
return m_of_in_day(dat);
}
Returns the offset.
Example
DateTime.parse('04pm+0730').offset #=> (5/16)