← index

TimeZone

inherits Object

An IANA time zone (America/New_York, Asia/Tokyo, …) or UTC — the zone component of a DateTime.

Look one up with TimeZone.of:, or take TimeZone.utc / TimeZone.system; then hand it to Timestamp#inZone:, DateTime#inZone: or DateTime.nowIn:. A zone carries the full DST rule set, not just an offset.

(TimeZone.of:'America/New_York').name     "* -> 'America/New_York'

Class methods

of:String

Look up a time zone by IANA name — TimeZone.of:'America/New_York'. An unknown name throws a ValueError.

native

system

The host's configured local zone (falling back to UTC when none can be determined).

native

utc

The UTC zone.

native

Instance methods

==:

Whether the argument is the same TimeZone. A non-TimeZone argument is simply unequal — never an error.

(TimeZone.of:'UTC') == TimeZone.utc     "* -> true

native

name

The IANA name ('America/New_York', 'UTC'), or '(fixed offset)' for an unnamed fixed-offset zone.

native

s

The same string as name.

native