Skip to content
instance method

Time#zone

() -> ::String?
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"

Ruby version changes

  1. 3.4
    • On Windows, now Time#zone encodes the system timezone name in UTF-8 instead of the active code page, if it contains non-ASCII characters. [Bug #20929]

See also #year #yday also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0