Class: TZInfo::TimezonePeriod

Class | TZInfo::TimezonePeriod
In: | lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_period.rb
Parent: | Object

A period of time in a timezone where the same offset from UTC applies.

All the methods that take times accept instances of Time, DateTime or integer timestamps.

### Methods

== abbreviation dst? eql? hash inspect local_after_start? local_before_end? local_end local_start new std_offset to_local to_utc utc_after_start? utc_before_end? utc_end utc_offset utc_start utc_total_offset utc_total_offset_rational valid_for_local? valid_for_utc? zone_identifier

### Attributes

end_transition | [R] | The TimezoneTransitionInfo that defines the end of this TimezonePeriod (may be nil if unbounded).
offset | [R] | The TimezoneOffsetInfo for this period.
start_transition | [R] | The TimezoneTransitionInfo that defines the start of this TimezonePeriod (may be nil if unbounded).

### Public Class methods

new(start_transition, end_transition, offset = nil)

Initializes a new TimezonePeriod.

### Public Instance methods

==(p)

Returns true if this TimezonePeriod is equal to p. This compares the start_transition, end_transition and offset using ==.

abbreviation()

The identifier of this period, e.g. "GMT" (Greenwich Mean Time) or "BST" (British Summer Time) for "Europe/London". The returned identifier is a symbol.

dst?()

true if daylight savings is in effect for this period; otherwise false.

eql?(p)

Returns true if this TimezonePeriods is equal to p. This compares the start_transition, end_transition and offset using eql?

hash()

Returns a hash of this TimezonePeriod.

inspect()

Returns internal object state as a programmer-readable string.

local_after_start?(local)

true if the given local DateTime is after the start of the period (inclusive); otherwise false.

local_before_end?(local)

true if the given local DateTime is before the end of the period (exclusive); otherwise false.

local_end()

The end time of the period in local time as a DateTime. May be nil if unbounded.

local_start()

The start time of the period in local time as a DateTime. May be nil if unbounded.

std_offset()

Offset from the local time where daylight savings is in effect (seconds). E.g.: utc_offset could be -5 hours. Normally, std_offset would be 0. During daylight savings, std_offset would typically become +1 hours.

to_local(utc)

Converts a UTC DateTime to local time based on the offset of this period.

to_utc(local)

Converts a local DateTime to UTC based on the offset of this period.

utc_after_start?(utc)

true if the given UTC DateTime is after the start of the period (inclusive); otherwise false.

utc_before_end?(utc)

true if the given UTC DateTime is before the end of the period (exclusive); otherwise false.

utc_end()

The end time of the period in UTC as a DateTime. May be nil if unbounded.

utc_offset()

Base offset of the timezone from UTC (seconds).

utc_start()

The start time of the period in UTC as a DateTime. May be nil if unbounded.

utc_total_offset()

Total offset from UTC (seconds). Equal to utc_offset + std_offset.

utc_total_offset_rational()

Total offset from UTC (days). Result is a Rational.

valid_for_local?(local)

true if this period is valid for the given local DateTime; otherwise false.

valid_for_utc?(utc)

true if this period is valid for the given UTC DateTime; otherwise false.

zone_identifier()

Alias for abbreviation

[Validate]