Intl.TimeZone
A TimeZone represents a time zone from the IANA database.
type TimeZone
The TimeZone type holds a valid IANA time zone.
fromIANATimeZoneName
:
String -> Maybe.Maybe Intl.TimeZone.TimeZone
Checks the string as a valid time zone, and returns a TimeZone if it is.
-- Hawaii time
fromIANATimeZoneName "Pacific/Honolulu"
If a string is passed that is not a valid time zone, Nothing
will be returned.
The string is matched in a case-insensitive manner.
toIANATimeZoneName
:
Intl.TimeZone.TimeZone -> String
Gets the canonicalized string time zone name from a TimeZone.
toIANATimeZoneName TimeZone.utc == "UTC"
Predefined TimeZones
The UTC time zones has been pre-defined for convenience. For additional time zones, you will need to use an IANA time zone name.
utc
:
Intl.TimeZone.TimeZone
Coordinated Universal Time