class Timezone
Ruby on Rails 2.2.3
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 (32)
- # acts_like?
- # app
- # blank?
- # class_eval
- # create
- # create_fixtures
- # duplicable?
- # edit
- # find_cmd
- # helper
- # index
- # instance_exec
- # instance_variable_defined?
- # instance_variable_names
- # message
- # metaclass
- # new_session
- # present?
- # reload!
- # returning
- # start_debugger
- # tail
- # to_json
- # to_param
- # to_query
- # unescape
- # update
- # with_options
- self. blank_slate_method_added
- self. find_hidden_method
- self. lookup_missing_generator
- self. method_added
From ActionController::Caching (3)
- # cache
- self. cache_configured?
- self. cache_store=
From ActionController::Cookies (2)
From ActionController::Flash (1)
- self. included
From ActionController::RecordIdentifier (5)
From ActionController::Rescue (7)
From ActionController::Streaming (2)
From ActionController::Translation (4)
From ActiveRecord::Callbacks (14)
From ActiveRecord::Dirty (4)
From ActiveRecord::Locking::Pessimistic (1)
- # lock!
From ActiveRecord::NamedScope (1)
- self. included
From ActiveRecord::Transactions (4)
From ActiveRecord::Validations (7)
From ActiveRecord::NamedScope::ClassMethods (2)
- # named_scope
- # scopes
From ActiveRecord::Validations::ClassMethods (13)
From ActiveSupport::Memoizable (1)
- # memoize