TimeZone
Inherits Comparable < Reference < Object
Constants
Keys are TimeZone names, values are TZ database names (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). https://github.com/rails/rails/blob/main/activesupport/lib/active_support/values/time_zone.rb
Constructors
Class methods
Returns an array of all TimeZone objects. There are multiple
TimeZone objects per time zone, in many cases, to make it easier
for users to find their own time zone.
Assumes self represents an offset from UTC in seconds (as returned from
Time#offset) and turns this into an "+HH:MM" formatted string.
TimeZone.seconds_to_utc_offset(10800) # => "+03:00"
Instance methods
Compares this TimeZone with other.
The two are compared first on their offsets, and then by name.
Returns a formatted string of the offset from UTC.
zone = TimeZone.new("Central Time (US & Canada)")
zone.formatted_offset # => "-06:00"
zone.formatted_offset(false) # => "-0600"
Creates a new Time instance representing the given local date-time in time zone.
Creates a new Time instance representing the current time from the
system clock observed in time zone.