Class: TimeCrisis::TZInfo::DataTimezone
- Inherits:
-
InfoTimezone
- Object
- Timezone
- InfoTimezone
- TimeCrisis::TZInfo::DataTimezone
- Defined in:
- lib/time_crisis/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.
14 15 16 |
# File 'lib/time_crisis/tzinfo/data_timezone.rb', line 14 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.
22 23 24 |
# File 'lib/time_crisis/tzinfo/data_timezone.rb', line 22 def periods_for_local(local) info.periods_for_local(local) end |