Class: TimeCrisis::TZInfo::LinkedTimezone

Inherits:
InfoTimezone show all
Defined in:
lib/time_crisis/tzinfo/linked_timezone.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from InfoTimezone

#identifier, new

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.



12
13
14
# File 'lib/time_crisis/tzinfo/linked_timezone.rb', line 12

def period_for_utc(utc)
  @linked_timezone.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.



20
21
22
# File 'lib/time_crisis/tzinfo/linked_timezone.rb', line 20

def periods_for_local(local)
  @linked_timezone.periods_for_local(local)
end