isaacseymour / deprecated-time / Time.TimeZone

This module defines a representations for Timezone information.

TimeZone values


type TimeZone

TimeZone represents the opaque type of timezone values. These are generally loaded from an external source via unpack.

See also http://momentjs.com/timezone/docs/#/data-formats/packed-format/.

name : TimeZone -> String

name returns a TimeZone's name.

abbreviation : Time.Posix -> TimeZone -> String

Given an arbitrary Time and a TimeZone, abbreviation returns the TimeZone's abbreviation at that Time.

offset : Time.Posix -> TimeZone -> Basics.Int

Given an arbitrary Time and a TimeZone, offset returns the TimeZone's UTC offset in milliseconds at that Time.

offsetString : Time.Posix -> TimeZone -> String

Given an arbitrary Time and TimeZone, offsetString returns an ISO8601-formatted UTC offset for at that Time.

Manipulating TimeZones

setName : String -> TimeZone -> TimeZone

setName updates a TimeZone's name.

Constructing TimeZones

unpack : String -> Result (List Parser.DeadEnd) TimeZone

unpackNew decodes a packed zone data object into a TimeZone value.

See also http://momentjs.com/timezone/docs/#/data-formats/packed-format/

Sadly exposed - internal really

errorZone : String -> TimeZone

A fake TimeZone which represents an error parsing zone data. Tests in this package verify it will never be returned.