Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Time#zone

time.zone → string or timezone

Returns the string name of the time zone for self:

Example
Time.utc(2000, 1, 1).zone # => "UTC"
Time.new(2000, 1, 1).zone # => "Central Standard Time"
See also #year #yday also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0