Class: TZInfo::LinkedTimezone

Inherits:
InfoTimezone show all
Defined in:
activesupport/lib/active_support/vendor/tzinfo-0.3.12/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.



33
34
35
# File 'activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone.rb', line 33

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.



41
42
43
# File 'activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone.rb', line 41

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