Class: TZInfo::DataTimezone
- Inherits:
-
InfoTimezone
- Object
- Timezone
- InfoTimezone
- TZInfo::DataTimezone
- Defined in:
- lib/gems/activesupport-2.2.2/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone.rb
Overview
A Timezone based on a DataTimezoneInfo.
Instance Method Summary collapse
-
#period_for_utc(utc) ⇒ Object
Returns the TimezonePeriod for the given UTC time.
-
#periods_for_local(local) ⇒ Object
Returns the set of TimezonePeriod instances that are valid for the given local time as an array.
Methods inherited from InfoTimezone
Methods inherited from Timezone
#<=>, #_dump, _load, all, all_country_zone_identifiers, all_country_zones, all_data_zone_identifiers, all_data_zones, all_identifiers, all_linked_zone_identifiers, all_linked_zones, #current_period, #current_period_and_time, #eql?, #friendly_identifier, get, get_proxy, #hash, #identifier, #inspect, #local_to_utc, #name, new, #now, #period_for_local, #strftime, #to_s, us_zone_identifiers, us_zones, #utc_to_local
Instance Method Details
#period_for_utc(utc) ⇒ Object
Returns the TimezonePeriod for the given UTC time. utc can either be a DateTime, Time or integer timestamp (Time.to_i). Any timezone information in utc is ignored (it is treated as a UTC time).
If no TimezonePeriod could be found, PeriodNotFound is raised.
35 36 37 |
# File 'lib/gems/activesupport-2.2.2/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone.rb', line 35 def period_for_utc(utc) info.period_for_utc(utc) end |
#periods_for_local(local) ⇒ Object
Returns the set of TimezonePeriod instances that are valid for the given local time as an array. If you just want a single period, use period_for_local instead and specify how abiguities should be resolved. Raises PeriodNotFound if no periods are found for the given time.
43 44 45 |
# File 'lib/gems/activesupport-2.2.2/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone.rb', line 43 def periods_for_local(local) info.periods_for_local(local) end |