all

all() Class Public 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.

create

create(name, utc_offset = nil, tzinfo = nil) Class Public methods Alias for: new

find_tzinfo

find_tzinfo(name) Class Public methods

new

new(name, utc_offset = nil, tzinfo = nil) Class Public methods Create a new TimeZone object with the given name and offset. The offset is the number of seconds that this time zone is offset from UTC (GMT). Seconds were chosen as the offset unit because that is the unit that Ruby uses to represent time zone offsets (see Time#utc_offset). create

new 2

new(name) Class Public methods Returns a TimeZone instance with the given name, or nil if no such TimeZone instance exists. (This exists to support the use of this class with the composed_of macro.)

seconds_to_utc_offset

seconds_to_utc_offset(seconds, colon = true) Class Public methods Assumes self represents an offset from UTC in seconds (as returned from Time#utc_offset) and turns this into an +HH:MM formatted string. TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00"

us_zones

us_zones() Class Public methods A convenience method for returning a collection of TimeZone objects for time zones in the USA.

zones_map

zones_map() Class Public methods

<=>

<=>(zone) Instance Public methods Compare this time zone to the parameter. The two are compared first on their offsets, and then by name.

=~

=~(re) Instance Public methods Compare name and TZInfo identifier to a supplied regexp, returning true if a match is found.