class Timezone
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Timezone is the base class of all timezones. It provides a factory method get to access timezones by identifier. Once a specific Timezone has been retrieved, DateTimes, Times and timestamps can be converted between the UTC and the local time for the zone. For example:
tz = TZInfo::Timezone.get('America/New_York') puts tz.utc_to_local(DateTime.new(2005,8,29,15,35,0)).to_s puts tz.local_to_utc(Time.utc(2005,8,29,11,35,0)).to_s puts tz.utc_to_local(1125315300).to_s
Each time conversion method returns an object of the same type it was passed.
The timezone information all comes from the tz database (see www.twinsun.com/tz/tz-link.htm)
Inherits from
Includes
Methods (defined here)
- # <=>
- # current_period
- # current_period_and_time
- # current_time_and_period
- # _dump
- # eql?
- # friendly_identifier
- # hash
- # identifier
- # inspect
- # local_to_utc
- # name
- # now
- # period_for_local
- # period_for_utc
- # periods_for_local
- # strftime
- # to_s
- # utc_to_local
- self. all
- self. all_country_zone_identifiers
- self. all_country_zones
- self. all_data_zone_identifiers
- self. all_data_zones
- self. all_identifiers
- self. all_linked_zone_identifiers
- self. all_linked_zones
- self. get
- self. get_proxies
- self. get_proxy
- self. _load
- self. load_index
- self. new
- self. us_zone_identifiers
- self. us_zones
Methods (inherited)
From Object (37)
- # acts_like?
- # app
- # as_json
- # blank?
- # class_eval
- # create
- # create_fixtures
- # destroy
- # duplicable?
- # edit
- # find_cmd
- # helper
- # html_safe?
- # index
- # instance_exec
- # instance_variable_defined?
- # instance_variable_names
- # message
- # metaclass
- # new_session
- # presence
- # present?
- # reload!
- # returning
- # singleton_class
- # tap
- # to_json
- # to_param
- # to_query
- # try
- # unescape
- # update
- # with_options
- self. blank_slate_method_added
- self. find_hidden_method
- self. lookup_missing_generator
- self. method_added