Class: TZInfo::TimezoneProxy

Class | TZInfo::TimezoneProxy
In: | lib/tzinfo/timezone_proxy.rb
Parent: | Timezone

A proxy class representing a timezone with a given identifier. TimezoneProxy inherits from Timezone and can be treated like any Timezone loaded with Timezone.get.

The first time an attempt is made to access the data for the timezone, the real Timezone is loaded. If the proxy‘s identifier was not valid, then an exception will be raised at this point.

### Methods

_dump _load identifier new period_for_utc periods_for_local

### Public Class methods

_load(data)

Loads a marshalled TimezoneProxy.

new(identifier)

Construct a new TimezoneProxy for the given identifier. The identifier is not checked when constructing the proxy. It will be validated on the when the real Timezone is loaded.

### Public Instance methods

_dump(limit)

Dumps this TimezoneProxy for marshalling.

identifier()

The identifier of the timezone, e.g. "Europe/Paris".

period_for_utc(utc)

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).

periods_for_local(local)

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. Returns an empty array if no periods are found for the given time.

[Validate]