justinmimbs/timezone-data/1.0.1

NOTE: the latest version is 11.1.2

TimeZone

Get the local time zone

getZone : Task Error ( String, Zone )

Try to get the local time zone. If the task succeeds, then you get the zone name along with the Time.Zone.

type Error
= NoZoneName
| NoDataForZoneName String

Represents an error that may occur when trying to get the local zone.

Get a specific time zone

unpack : Pack -> Zone

Convert a TimeZone.Data.Pack to a Time.Zone.

import Time
import TimeZone exposing (unpack)
import TimeZone.Data


zone : Time.Zone
zone =
    unpack TimeZone.Data.america__new_york